C programming Questions
C programming For Recent college graduates and professionals for job interview.:
————-
some small C programs are given asked to tell the function/errors etc.
one of the question(last in the paper) is an invalid statement. finish of all these very fast and think about those others. they are simple only.
1.
int a=2,b=3,c=4;
printf("a=%d,b=%d\n",a,b,c);
ANS:2,3
2.for(i=1;i<10;++i,printf("%d",i));+-
ANS:compiling error.
3.whole logic is given in func s but they are working properly. the main logic is :
char *string;
string=malloc(5*sizeof(char));
strcpy(string,"hello");
printf("%s",string); /* func to print */
ANS: hello and some extra characters until uccerence of \0 .
4. in a system integer takes 3bytes and char takes 1byte …….
struct smthing{
int a;
char b[4];
};
ANS : sizeof struct smithing is 7 bytes.
pls publish some hard question of command line argument…
Thanks….
I need some more questions…
It will be more helpful if u post topic wise question & answers…
l need topicwise interview questions of c for freshers
for easy storage and retrieval of data wat method is used in data structure and and write a program regarding that?
if any one know the ans plz reply
Thanks….
I need some more questions…
It will be more helpful if u post topic wise question & answers…
i needsmall question & answers
i need topic wise question&answers
hai,
gud questions.it will b helpfull to me.
Thank u.
Left some comment in this link.
nice,more usefull that candidates like me thank u
it will be helpful to me