|
INTERVIEW QUESTIONS
MAINFRAME
JCL
DETAILS
Question: 61) main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
Answer: Answer: Compiler error (at line number 4): size of v is Unknown. Explanation: You can create a variable of type void * but not of type void, since void is an empty type. In the second line you are creating variable vptr of type void * and v of type void hence an error.
|
|
|
Category |
JCL Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 7687 users |
Added on |
9/2/2014 |
Views |
66163 |
Rate it! |
|
|
Question:
61) main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
Answer:
Answer: Compiler error (at line number 4): size of v is Unknown. Explanation: You can create a variable of type void * but not of type void, since void is an empty type. In the second line you are creating variable vptr of type void * and v of type void hence an error. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
main() { main(); }
|
View Answer
|
|
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF)
|
View Answer
|
|
58) main() { char name[10],s[12]; scanf(" "%[^"]"",s); } How scanf will execute?
|
} How scanf will execute - JCL Interview Questions & Answers">
View Answer
|
|
56) What are the files which are automatically opened when a C file is executed? Answer: stdin, stdout, stderr (standard input,standard output,standard error).
|
View Answer
|
|
55) main() { int i=-1; +i; printf("i = %d, +i = %d
",i,+i); }
|
} - JCL Interview Questions & Answers">
View Answer
|
|
54) int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }
|
View Answer
|
|
53) main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s
”,x); x++; } }
|
View Answer
|
|
52) main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }
|
View Answer
|
|
51) main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }
|
View Answer
|
|
50) main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
|
View Answer
|
|
49) main( ) { static int a[ ] = {0,1,2,3,4}; int *p[ ] = {a,a+1,a+2,a+3,a+4}; int **ptr = p; ptr++; printf(“
%d %d %d”, ptr-p, *ptr-a, **ptr); *ptr++; printf(“
%d %d %d”, ptr-p, *ptr-a, **ptr); *++ptr; printf(“
%d %d %d”, ptr-p, *ptr-a, **ptr); ++*ptr; printf(“
%d %d %d”, ptr-p, *ptr-a, **ptr); }
|
View Answer
|
|
48) main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }
|
View Answer
|
|
47) main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d
”,a,*a,**a,***a); printf(“%u %u %u %d
”,a+1,*a+1,**a+1,***a+1); }
|
View Answer
|
|
46) main() { show(); } void show() { printf("I'm the greatest"); }
|
} - JCL Interview Questions & Answers">
View Answer
|
|
45) main() { extern out; printf("%d", out); } int out=100;
|
} int out=100; - JCL Interview Questions & Answers">
View Answer
|
|
44) main() { printf("%d", out); } int out=100;
|
} int out=100; - JCL Interview Questions & Answers">
View Answer
|
|
43) main() { extern int i; i=20; printf("%d",sizeof(i)); }
|
} - JCL Interview Questions & Answers">
View Answer
|
|
42) #include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
|
View Answer
|
|
41) #include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }
|
View Answer
|
|
40) #include<stdio.h> main() { char s[]={'a','b','c','
','c','
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All JCL Interview Questions & Answers - Exam Mode /
Learning Mode
|