Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

in c++ Not java l), LlR 8h the square root button (above the text box) and then

ID: 3754456 • Letter: I

Question

in c++ Not java

l), LlR 8h the square root button (above the text box) and then click Switch to Advanced View. Here, you can type equations in Latex format. Remember for ubscripts and when the subscript is more than one character, enclose in brackets; for example: x (n+2) Que Que Que Remember that when typing code, make sure the paragraph style is Preformatted (so it looks like a typewriter) and make sure to indent/ align your code properly. Time Runnir Attempt due: S 59 Minutes D Question 1 1 pts Suppose you want to store the word apple as a string str in C. What declaration would you use? O char str O char strl: char str[5); char str[6]; +10

Explanation / Answer

Question 1).The Right option is B).char str[ ];

A).it declares a variable named str of type char.it can't store string.

B).It declares a array of type char which can store string of any length.

For example:- char str[ ] = "apple";

This will generate array of length six first five for apple and last for ''.

C).It declares array of type char of length 5.it stores characters not string at once.it can store string indirectly but without '' character string is worthless.

D).It declares a array of length 6 of type char.it will store string indirectly.

In C++,all C standards can be used effectively.but in c++ there is standard library called string which directly allows us to declare variable of type string.