Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



consider the following structure: struct num nam{ int no; char..

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

consider the following structure: struct num nam{ int no; char..

Answer / santlal kurmi

The correct answer is
a. 8,9
because *(n1+2) means a[2]

Is This Answer Correct ?    4 Yes 0 No

consider the following structure: struct num nam{ int no; char..

Answer / guest

d

Is This Answer Correct ?    3 Yes 0 No

consider the following structure: struct num nam{ int no; char..

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

Post New Answer

More C Interview Questions

What is the best way of making my program efficient?

0 Answers  


Is main is a keyword in c?

0 Answers  


What is difference between stdio h and conio h?

0 Answers  


How do you do dynamic memory allocation in C applications?

0 Answers  


How do you list files in a directory?

0 Answers  


"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

0 Answers  


Is there a way to switch on strings?

0 Answers  


What is difference between structure and union in c?

0 Answers  


logic for x=y^n

1 Answers   Delphi,


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

0 Answers   Google,


how logic is used

0 Answers  


Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage

7 Answers   Accenture,


Categories