what would be the output of the following prog? Justify
your answer?
main()
{
unsigned char ch;
unsigned char i;
ch = -255;
printf("%d",ch);
i = -1;
printf("%d",i);
}
Answer / bittu
1255
this is because -255 (00000001) when considered unsigned
looks like 1(00000001) in binary and -1(11111111) when
considered unsigned looks like 255(11111111) in binary
(11111111).
refer to this
http://www.allaboutcircuits.com/vol_4/chpt_2/3.html
Is This Answer Correct ? | 5 Yes | 0 No |
Can the sizeof operator be used to tell the size of an array passed to a function?
What is output redirection?
Give the logic for this #include<stdio.h> #include<conio.h> void main() { clrscr(); int a=10,b; b=++a + ++a; printf("%d", b); getch(); } Output: 24......How?
what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }
You have an array of n integers, randomly ordered with value 1 to n-1.The array is such that there is only one and one value occurred twice. How will you find this number?
how should functions be apportioned among source files?
Is c compiled or interpreted?
which is the best antivirus and how to update it
. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none
What is hungarian notation? Is it worthwhile?
What is static memory allocation? Explain
the expression a=30*1000+2768; evalutes to a) 32768 b) -32768 c) 113040 d) 0