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 does node * mean?
pgm in c to reverse string by word using array(god is love becomes love is god) (no additional array can used,space is only delimiter between words )
find the minimum of three values inputted by the user
Write a program using bitwise operators to invert even bits of a given number.
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
What is the acronym for ansi?
What is structure in c explain with example?
5. What kind of sorting is this: SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }
Is the following code legal? struct a { int x; struct a b; }
Write a factorial program using C.