GrapeCity Placement - Technical paper - C/C++ questions
GrapeCity Placement - Technical paper - C/C++ questions
• Choose from the below given options which should be used as a constant reference parameter?
a.Whenever the data type might be many bytes, the function changes the parameter within its body and you do not want these changes to alter the actual agreement.
b.Whenever the data type might be many bytes
c.Whenever the data type might be many bytes, the function changes the parameter within its body and you do want these changes to alter the actual argument.
• Find the output of
Integer a=3, b=17;
a=b%a;
b=++a+5;
printf(“a,b);
a.37
b.27
c.28
d.None of the above
• When should you use a pointer p as a reference parameter?
a.When function changes *p, and you do not want the change to affect actual pointer argument
b.When function changes p and you want the change to affect actual pointer argument
c.When pointer points to large object
d.When function changes p and you do not want the change to affect actual pointer argument
e.When function changes *p and you want the change to affect actual pointer argument
• The function call quiz (5) can print how many asterisks?
a.4
b.8
c.7
d.3
• Choose the correct option for:
Char string [8] = abcdefg;
*string=”;
printf(“%s, string);
a.Run – time error
b.Compile error
c.Creates bcdefg
d.No output, but no error