#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

write a c-program to display the time using FOR loop

3 Answers   HCL,


write the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

0 Answers   TCS,


Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

7 Answers   Microsoft,


There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.

1 Answers   TCS,






main() { extern int i; i=20; printf("%d",i); }

1 Answers   Value Labs,


What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.

3 Answers   Wipro,


Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


main() { char not; not=!2; printf("%d",not); }

1 Answers  


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

11 Answers   Infotech, TC,


Categories