Recent questions tagged programming

0 votes
1 answer
541
What would be the equivalent pointer expression for referring the array element a[i][j][k][l]?A. ((((a+i)+j)+k)+l)B. *(*(*(*(a+i)+j)+k)+l)C. (((a+i)+j)+k+l)D. ...
1 votes
2 answers
542
#include <stdio.h int main() { //code int x; printf("%d",printf("A")+printf("BC")*printf("DEF")); return 0; }What should be the output of following program? Please explai...
3 votes
4 answers
543
Assume sizeof an integer and a pointer is 4 byte. Output?#include<stdio.h #define R 10 #define C 20 int main() { int *p[R][C]; printf("%d",sizeof(*p)); printf("%d",sizeof...
0 votes
1 answer
545
The Correct answer is c but how?int main(){ int a=210,b=120,c; c=a>b?1,2,3:2,5,6,7; printf("%d",c);}ans:-a) 1b) 2c) 3d) Error.
0 votes
2 answers
546
printf("%d",20/3.2); or printf("%i",20.0/3); or %u // why does it prints garbage value Could someone explain(or provide info) about format specifiers %d, %s, %f.....
0 votes
0 answers
548
why did constructor's name is same as class name and it has no return type
1 votes
1 answer
549
what will be the output of the following piece of code? void add() { int i=11; printf("%d",++i|i++); }
0 votes
2 answers
551
swap(int c, int d) { int k,t; k=3; t=c; c=d; d=t; k=c+d+t; } main() { int k=5, l=9; swap(k,l); printf("%d,%d",k,l); }9,55,95,1919,5
0 votes
0 answers
552
#include<stdio.h int fun1(int x) { x=14; } int fun2(int x) { x=20; } int main() { int(*p)(),m,n; scanf("%d",&m); if(m) p=fun1; else p=fun2; n=(*p)(); printf("%d",n); retu...
0 votes
0 answers
553
#include<stdio.h int main() { char a[]={'A','B','C','D'}; char *p=&a[0]; *p++; printf("%c%c",*++p, *p); }What will be the output?1)C B2)B B3)B A4)C A
0 votes
1 answer
554
Which of the following statement about loop is correct?Index value retained outside the loopIndex value can be changed from within the loopGoto can be used to jump, out o...
0 votes
3 answers
555
main ( ) { int a = 2, b, c; a* = b = c = 4; a = b = c; printf(“%d”, a); a = = (b = c); printf(“%d”, a); } What will be the output? And How.$1, 4$$4, 4$$1, 1$$ 8, ...
2 votes
1 answer
560
#include<stdio.h int main() { int x=191; char *p; p=(char*)&x; printf("%d",*p); }explain it
0 votes
2 answers
563
What will be the output: #include <iostream using namespace std; int main() { char *A[] = { "abcx", "dbba", "cccc"}; char var = *(A+1) - *A+1; cout << (*A + var); }1. $ab...
0 votes
1 answer
564
member selection via pointer is P - Ccan we write it in terms of normal pointer , if yes then what it is ?is it written like (*P ) . C ??
0 votes
1 answer
565
My answer is 42 but given answer is 2018 please explain how ?
1 votes
1 answer
566
can someone verify the answer?my ans is 15 but ans given is 13
2 votes
1 answer
567
Why printf("%d",5%-2); is 1, not -1.
1 votes
0 answers
568
What is the output of the following program?void main(){printf("%d",5%2);printf("%d",-5%2);printf("%d",5%-2);printf("%d",-5%-2);printf("%d",2%5);}A) 1,-1 -1 1 0B)1 -1 1 -...