Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

#include<stdio.h>

main()

{

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

char *p,*str,*str1;

p=&s;

str=p;

str1=s;

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

}

Answers were Sorted based on User's Feedback

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

M

Explanation:

p is pointing to character '\n'.str1 is pointing to
character 'a' ++*p meAnswer:"p is pointing to '\n' and that
is incremented by one." the ASCII value of '\n' is 10. then
it is incremented to 11. the value of ++*p is 11. ++*str1
meAnswer:"str1 is pointing to 'a' that is incremented by 1
and it becomes 'b'. ASCII value of 'b' is 98. both 11 and 98
is added and result is subtracted from 32.

i.e. (11+98-32)=77("M");

 Is This Answer Correct ? 15 Yes 1 No

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

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 ? 2 Yes 0 No

More C Code Interview Questions

write a program for area of circumference of shapes

int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().

how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.

Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false

main() { int i=5; printf("%d",++i++); }

Write a routine that prints out a 2-D array in spiral order

Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

main() { static int a={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }

Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

program to Reverse a linked list

main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000

can u give me the c codings for converting a string into the hexa decimal form......

Categories
• C Code (422)
• C++ Code (128)
• VC++ Code (17)
• Java Code (84)
• Dot Net Code (114)
• Visual Basic Code (11)
• Programming Code AllOther (62)