#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 |
Implement a t9 mobile dictionary. (Give code with explanation )
1 Answers Amazon, Peak6, Yahoo,
main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }
Write a program that reads a dynamic array of 40 integers and displays only even integers
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }
Write a complete program that consists of a function that can receive two numbers from a user (M and N) as a parameter. Then print all the numbers between the two numbers including the number itself. If the value of M is smaller than N, print the numbers in ascending flow. If the value of M is bigger than N, print the numbers in descending flow. may i know how the coding look like?
writte a c-programm to display smill paces
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
how to swap 3 nos without using temporary variable
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.
Write a c program to search an element in an array using recursion
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }