Recent questions tagged programming-in-c

3 votes
2 answers
1171
#include<stdio.h>int *m();void main(){int *k=m();printf("Hello");printf("%d",k[0]);}int *m(){int a ={5,8};return a;} What is the output generated?A)hello 5 8B)hello 5C)he...
1 votes
1 answer
1172
#include<stdio.h>int func(){return (double)(char)5.0;}What will be the data type returned?A)charB)intC)doubleD)multiple type casting in return is illegal
5 votes
1 answer
1173
#include<stdio.h int Abc(){ static int i = 19; return i; } int main(){ for(Abc() ; Abc() ; Abc()){ printf("%d ", Abc()); } return 0; }
2 votes
3 answers
1175
What type of conversion is not accepted in C ?a. from char to int b. from float to char pointerc.from negative int to chard. from double to char
3 votes
5 answers
1176
#include<stdio.h>int f(int a){ a 20 ? return 10: return 20;}int main(){int b=fun(20);return 0;}what will be the output of this program ?
1 votes
2 answers
1177
#include<stdio.h>int main(){short int i=20;char c=97;printf("%d %d %d\n",sizeof(i),sizeof(c),sizeof(i+c));return 0;} could anyone explian why the answer of sizeof(i+c) is...
4 votes
3 answers
1179
What will be the output of the program ?#include<stdio.h int main() { int i=4, j=8; printf("%d, %d, %d\n", i|j&j|i, i|j&j|i, i^j); return 0; } A.12, 12, 12 B.112, 1, 12 C...
5 votes
3 answers
1182
Will it result in to an error if a header file is included twice?[A].Yes[B].No[C].It is compiler dependent
4 votes
1 answer
1183
If a char is 1 byte wide, an integer is 2 bytes wide and a long integer is 4 bytes wide then will the following structure always occupy 7 bytes?struct ex { char ch; int i...
4 votes
0 answers
1187
Does there exist any way to make the command-line arguments available to other functions without passing them as arguments to the function? A.Yes B.No
4 votes
1 answer
1188
4 votes
1 answer
1189
Point out the error in the program?struct emp { int ecode; struct emp *e; };[A].Error: in structure declaration[B].Linker Error[C].No error[D].None of above
0 votes
0 answers
1190
What is the input and output of increment/decrement operator in the C language in terms of rvalue and lvalue?
0 votes
1 answer
1192
what is the difference between implicit and explicit type casting??
0 votes
2 answers
1193
Consider the following program, what will be the output -?#include<stdio.h int main() { int a[m][n]={{1,2,3},{4,5,6}}; int i,j; for(i=0;i<m;i++) { ...
1 votes
1 answer
1194
What will be the output of the following program-?int main(){ char *str="india"; printf("%d\n",country(str)); return 0; } int country(int *p1) { int *p2=p...
8 votes
1 answer
1195
0 votes
1 answer
1196
1 votes
1 answer
1198
main() { int * ptr =(int *) malloc (5*sizeof(int)); for(i=0;i<5;i++) *(ptr+i)=i; pf("%d",*ptr++); pf("%d",(*ptr)++); pf("%d",*ptr1); pf("%d",*++ptr); pf("%d",++*ptr); }
0 votes
3 answers
1199
#include <stdio.h void f(int,int); int main(void){ int a = 5; f(a,a); printf("%d",a); } void f(int x, int y){ x ; y=y+15; }If copy-restore is used, then what will be the ...
1 votes
1 answer
1200
Explain the Output of the Following C Code: int main() { char s[]={'g','a','t','e','c','s'}; char r[]={'G','A','T','E','C','S'}; char *p,*q,*str1,*str2; p=&s[4]; q=&r ; s...