#include<stdio.h>

main()

{

char s[]={'a','b','c','\n','c','\0'};

char *p,*str,*str1;

p=&s[3];

str=p;

str1=s;

printf("%d",++*p + ++*str1-32);

}



#include<stdio.h> main() { char s[]={'a','b','c&..

Answer / susie

Answer :

77

Explanation:

p is pointing to character '\n'. str1 is pointing to
character 'a' ++*p. "p is pointing to '\n' and that is
incremented by one." the ASCII value of '\n' is 10, which is
then incremented to 11. The value of ++*p is 11. ++*str1,
str1 is pointing to 'a' that is incremented by 1 and it
becomes 'b'. ASCII value of 'b' is 98.

Now performing (11 + 98 – 32), we get 77("M");

So we get the output 77 :: "M" (Ascii is 77).

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More C Code Interview Questions

int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could anyone explain this to me.

2 Answers   Bosch, eInfochips, HCL, IHCL,


write a c program to print magic square of order n when n>3 and n is odd?

1 Answers   HCL,


#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 Answers  


main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 Answers  


void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }

1 Answers  






#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }

1 Answers  


How we print the table of 3 using for loop in c programing?

7 Answers  


main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 Answers  


void ( * abc( int, void ( *def) () ) ) ();

1 Answers  


Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  


main() { printf("%d", out); } int out=100;

3 Answers  


Categories