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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you allocate arrays or structures bigger than 64K?

683


What happens if a header file is included twice?

598


what is the basis for selection of arrays or pointers as data structure in a program

3788


There seem to be a few missing operators ..

619


how to find anagram without using string functions using only loops in c programming

2718






Why calloc is better than malloc?

572


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?

1918


What is the use of #define preprocessor in c?

618


Can 'this' pointer by used in the constructor?

614


Explain what are global variables and explain how do you declare them?

642


What is the difference between if else and switchstatement

1312


What is string in c language?

626


Are global variables static in c?

676


Add Two Numbers Without Using the Addition Operator

354


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

1783