consider the following structure:
struct num nam{
int no;
char name[25];
};
struct num nam
n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);
What does the above statement print?
a.8,9
b.9,9
c.8,8
d.8,unpredictable value
Answers were Sorted based on User's Feedback
Answer / jai
Compilation error. Otherwise if rewritten printf statement
is:
printf("%d,%d", n1[2].no, (*(n1+2).no)+1);
then answer is a. 8,9
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / santlal kurmi
The correct answer is
a. 8,9
because *(n1+2) means a[2]
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vignesh1988i
the above structure name is an invalid name , since it has encountered a space..... pl. rectify this error, and decleration of array of structure is also not valid...
if this errors are rectified , and we cant refer a structure through ',' operator.... only '.' or -> should be used... so, pl. try to correct it..
the o/p is : 8,9
thank u
| Is This Answer Correct ? | 2 Yes | 0 No |
What are unions in c?
Explain do array subscripts always start with zero?
where do we use volatile keyword?
Find the O/p of the following 1) #include int main() { char c='1'; int j=atoi(c); }
what is the similarities between. system call and library function?
main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
Explain the difference between struct and union.
program for reversing a selected line word by word when multiple lines are given without using strrev
What is use of pointer?
What's the difference between DELETE TABLE and TRUNCATE TABLE commands?
Is c is a procedural language?