main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
556
Explanation:
The integer value 300 in binary notation is: 00000001
00101100. It is stored in memory (small-endian) as:
00101100 00000001. Result of the expression *++ptr = 2 makes
the memory representation as: 00101100 00000010. So the
integer corresponding to it is 00000010 00101100 => 556.
| Is This Answer Correct ? | 77 Yes | 8 No |
Answer / bidhu
I think the answer depends on compiler.
In Dev-C++ the result is cannot convert int* to char* error
In Code:Block it gives a warning but gives the result 556
| Is This Answer Correct ? | 1 Yes | 3 No |
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
write a c program to Reverse a given string using string function and also without string function
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
Write a C program to add two numbers before the main function is called.
Cluster head selection in Wireless Sensor Network using C programming language.
How we print the table of 3 using for loop in c programing?
write a program to find out roots of quadratic equation "x=-b+-(b^2-4ac0^-1/2/2a"
main() { int i=5,j=6,z; printf("%d",i+++j); }
4. Main() { Int i=3,j=2,c=0,m; m=i&&j||c&I; printf(“%d%d%d%d”,I,j,c,m); }
#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); }
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }