You are here : Home >> All Company Study Materials >> Capgemini Archive >> Capgemini Pseudo Code Questions
3. Which of the following statements is true regarding, Auto Storage Class ?
A. It is used to give a reference of a global variable that is visible to all program files.
B. It instructs the compiler to keep a local variable in existence during the lifetime of a program.
C. It is the default storage class for all local variables.
D. It is used to define local variables that should be stored in a register.
Ans. C
4. What is the output of given code :
#include<stdio.h>
int main()
{
int x =4, y = 0;
int z;
z = (y++, y);
printf(“%d\n”, z);
return 0;
}
A. 1
B. 0
C. Undefined Behavior due to order of evaluation can be different.
D. Compilation Error
Ans. A
Explanation : Consider the line : z = (y++, y)
So, at first z is assigned with y++ after this statement y is incremented to 1.
Next expression is z = y, so z = 1.
sir in ques 1 answer should be ‘b’ i guess
No.
The answer is neither ‘b’ and nor ‘a’ it is ‘c’ because elements of upper triangle of the matrix are getting copied to lower triangle of the matrix therefore it is making the matrix ‘Symmetric’.
Sir can you please explain how c will be the option of question 2
Can u provide explanation…..
Sir my suggestions is that you should add the whole solutions of questions because anybody having trouble how they resolve their issue.
And is my solution and your option does not match how i get the concept???
Answer of Question No. 7 is 21