|
Question |
Rating |
View Answer |
|
80) main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }
|
|
View Answer |
|
81) main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
|
|
View Answer |
|
81) main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
|
|
View Answer |
|
82) # include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }
|
|
View Answer |
|
83) # include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }
|
|
View Answer |
|
85) #include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
|
|
View Answer |
|
87) main() { int i; i = abc();Answer: 0..0 Explanation: The value of i is 0. Since this information is enough to determine the truth value of the boolean expression. So the statement following the if statement is not executed. The values of i and j remain unchanged and get printed.
printf("%d",i); } abc() { _AX = 1000; }
|
|
View Answer |
|
88) int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d
",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p
|
|
View Answer |
|
89) main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
|
|
View Answer |
|
90) main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
|
|
View Answer |
|
91) In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }
|
|
View Answer |
|
92) What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }
|
|
View Answer |
|
93) main() { char *p; p="%d
"; p++; p++; printf(p-2,300); }
|
|
View Answer |
|
94) main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }
|
|
View Answer |
|
95) func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !
",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }
|
|
View Answer |
|
96) void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }
|
|
View Answer |
|
96) void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }
|
|
View Answer |
|
97) void main() { int k=ret(sizeof(float)); printf("
here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
|
|
View Answer |
|
98) void main() { char a[]="12345 |
|
View Answer |
|
99) void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u
",gotit=--giveit); }
|
|
View Answer |