#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 |
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }
how can i cast a char type array to an int type array
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above
4 Answers Corporate Society, HCL,
¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...
main() { char a[4]="HELLO"; printf("%s",a); }
{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }