0% found this document useful (0 votes)
39 views9 pages

What Will Be The Output of The Program ?: #Include

The program declares a character pointer str and initializes it to "%s". It then uses str in a printf statement to print "K\n". The output of the program will be "K".

Uploaded by

kav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views9 pages

What Will Be The Output of The Program ?: #Include

The program declares a character pointer str and initializes it to "%s". It then uses str in a printf statement to print "K\n". The output of the program will be "K".

Uploaded by

kav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

What will be the output of the program ?

#include<stdio.h>

int main()

static char *s[] = {"black", "white", "pink", "violet"};

char **ptr[] = {s+3, s+2, s+1, s}, ***p;

p = ptr;

++p;

printf("%s", **p+1);

return 0;

a.
let

b.

ink

c.

ite

d.

ack

Clear my choice

Question ​2

Not yet answered

Marked out of 1.00

Flag question

Question text
What will be the output of the program ?

#include<stdio.h>

int main()

int i=3, *j, k;

j = &i;

printf("%d\n", i**j*i+*j);

return 0;

a.

3
b.

27

c.

d.

30

Clear my choice

Question ​3

Not yet answered

Marked out of 1.00

Flag question

Question text

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.

*(*(*(*(a+i)+j)+k)+l)

Clear my choice

Question ​4
Not yet answered

Marked out of 1.00

Flag question

Question text

What will be the output of the program ?

#include<stdio.h>

int main()

char *str;

str = "%s";

printf(str, "K\n");

return 0;
}

a.

No output

b.

Error

c.

%s

d.

Clear my choice

Question ​5

Not yet answered


Marked out of 1.00

Flag question

Question text

What will be the output of the program ?

#include<stdio.h>

int main()

int x=30, *y, *z;

y=&x; /* Assume address of x is 500 and integer is 4 byte


size */

z=y;

*y++=*z++;

x++;
printf("x=%d, y=%d, z=%d\n", x, y, z);

return 0;

a.

x=31, y=504, z=504

b.

x=31, y=502, z=502

c.

x=31, y=500, z=500

d.

x=31, y=498, z=498

Clear my choice

You might also like