You are here : Home >> All Company Study Materials >> Capgemini Archive >> Capgemini Pseudo Code Questions
23. What will be the output of following code :
#include<stdio.h>
int x = 0;
int main(){
if(x == x)
printf(“if”);
else
printf(“else”);
return 0;
}
A. Two same variables can not be compared
B. ifelse
C. else
D. if
Ans D
Explanation : Above code involves simple comparison
24. What will be the output of following code :
#include<stdio.h>
#define FALSE -1
#define NULL 0
#define TRUE 1
int main(){
if(NULL)
printf(“NULL”);
else if(FALSE)
printf(“TRUE”);
else
printf(“FALSE”);
return 0;
}
A. TRUE
B. FALSE
C. NULL
D. Error
Ans. A
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