main()
{
printf("%x",-1<<4);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
fff0
Explanation :
-1 is internally represented as all 1's. When
left shifted four times the least significant 4 bits are
filled with 0's.The %x format specifier specifies that the
integer value be printed as a hexadecimal value.
Is This Answer Correct ? | 119 Yes | 22 No |
Answer / sourab
thts ans is ture 4 16 bit compiler ,for 32 bit ans is fffffff0.
Is This Answer Correct ? | 40 Yes | 9 No |
main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }
Is this code legal? int *ptr; ptr = (int *) 0x400;
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
main() { static int var = 5; printf("%d ",var--); if(var) main(); }
main() { int i=5,j=6,z; printf("%d",i+++j); }
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
main() { main(); }
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }
What is your nationality?
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