#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);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
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 |
Answer / kiran kumar maharana
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 |
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
Write a procedure to implement highlight as a blinking operation
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
Is the following code legal? typedef struct a { int x; aType *b; }aType
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }
main() { printf("%d", out); } int out=100;
Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.
main() { int i = 3; for (;i++=0;) printf(“%d”,i); }
How will u find whether a linked list has a loop or not?
why nlogn is the lower limit of any sort algorithm?