main()
{
int i = 0xff ;
printf("\n%d", i<<2);
}
a. 4
b. 512
c. 1020
d. 1024
Answers were Sorted based on User's Feedback
Answer / pavan_mustyala
binary representation of 0xff is 11111111
left shift by 2 results in 1111111100 which is equivalent
to 1020 in decimal.
| Is This Answer Correct ? | 22 Yes | 0 No |
prog. to produce 1 2 3 4 5 6 7 8 9 10
can u give me the c codings for converting a string into the hexa decimal form......
main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }
#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; }
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
main() { static int var = 5; printf("%d ",var--); if(var) main(); }
How do you write a program which produces its own source code as its output?
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
#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); }
Program to find the largest sum of contiguous integers in the array. O(n)
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }