Recent questions tagged programming-in-c

1 votes
1 answer
1112
int main() { int i,j; char a [3]={{'a','b','c'},{'d','e','f'}}; char b[3] ; char *p=*b; for(i=0;i<2;i++) { for(j=0;j<3;j++) { *(p+2*j+i)=a[i][j]; } } }please explain this...
1 votes
2 answers
1115
Can you see why the output of the following code is 256?main () { int a=0x1ff; char *careful= &a; *careful = 0; printf("%d", a); }
2 votes
0 answers
1117
Inside a program loopif we write*ch1++it will give "lvalue required" errorbut without any loop if we write even++*ch1++;it will not give any lvalue error. Why?
0 votes
1 answer
1119
1 votes
2 answers
1120
What will be output of below program#include<stdio.h int tech(int,int); int main(void){ int a=tech(15,4); printf("%d",a); return 0; } int tech(int p,int q){ if(p%q==0) re...
1 votes
1 answer
1121
2 votes
2 answers
1122
int main() { char str[10]="GATE2018"; int length=strlen(str); str[length]='\0'; for(i=0;str[i];i++) printf("%c",str[i]); return 0; }Find the output?
4 votes
1 answer
1123
for(i=0;i<=n;i++){ for(j=0;j<=i2;j++){ for(k=0;k<=$\frac{n}{2}$;k++){ x=y+z;}}}How many times the x=y+z statement will execute?
1 votes
2 answers
1124
int main() { int i=-1, j=-1,k=0,l=2,m; m= i++ && j++ && k++ || l++ ; printf("%d %d %d %d %d", i,j,k,l,m); return 0; }
0 votes
2 answers
1127
rec(int x) { static int f; if(x==1) return 1; else f+=x*rec(x-1); return(f); }the value returned by rec(5) is_____________
2 votes
1 answer
1128
What is the output of the following program?int main ( ){char *str = “Gate2018”printf (“%d”, output (str)) ;return 0;}int output(char *P1){char *P2 = P1 ;while (*...
1 votes
1 answer
1129
i=0;j= i ;printf( i++ + i + i + j + i + i);the output??
3 votes
1 answer
1130
Ans given is D.I want to know the logic behind
0 votes
3 answers
1131
#include<stdio.h>int main(){ int a=10,b=20,c=30;c==a==b;Printf("%d%d%d",a,b,c);return0;}
4 votes
1 answer
1133
The following program#include<stdio.h main ( ) { int abc ( ); abc ( ); (*abc) ( ); } int abc ( ) { printf (“come”);}(a) results in a compilation error (b) prints come...
0 votes
0 answers
1134
3 votes
2 answers
1135
#include<stdio.h #include<conio.h #include<string.h void main() { char *p="good"; char a[]="good"; printf("%d%d%d",sizeof(p),sizeof(*p),strlen(p)); printf("%d%d",sizeof(a...
0 votes
0 answers
1138
what is the use of type qualifiers in C? provide some examples.
0 votes
0 answers
1139
Please explain What is properly balanced parenthesis?Keyword is properly. Kindly give some examples also.
0 votes
1 answer
1140