main()
{
char x = 0x8A;
unsigned int y = x;
printf("%d\n", y);
}
A. -118
B. 138
C. 118
D. Unpredictable
Friday, December 26, 2008
Wednesday, December 17, 2008
Which of the following is the correct output for the program given below?
main() {
char ch;
if((ch=printf(248)))
printf("You are Boss");
else
printf("I am Boss");
}
a. You are Boss
b. I am Boss
c. No output
d. None of these
char ch;
if((ch=printf(248)))
printf("You are Boss");
else
printf("I am Boss");
}
a. You are Boss
b. I am Boss
c. No output
d. None of these
Saturday, December 6, 2008
Find the output of following programme
#include
#include
int main()
{
printf("%c\n", 'mujhe khoon do main tumhe pani duungah' -3);
return 0;
}
a. warning,Outputs: -h
b. error
c. warning, Outputs: e
d. warning, Outputs: n
e. warning, Outputs: (ascii value of h)
#include
int main()
{
printf("%c\n", 'mujhe khoon do main tumhe pani duungah' -3);
return 0;
}
a. warning,Outputs: -h
b. error
c. warning, Outputs: e
d. warning, Outputs: n
e. warning, Outputs: (ascii value of h)
Friday, December 5, 2008
What is the output of following programme ?
int main()
{
int a[5]={0,1,2,3,4,5};
unsigned int b = 0xffffffff;
a[b] = 30;
printf("%d\n", a[-1]);
a[-1] = 50;
printf("%d %d\n", a[-1],b);
}
a. Error
b. Garbage Garbage 1
c. 30 50 -1
d. -30 -50 1
e. None of the above
{
int a[5]={0,1,2,3,4,5};
unsigned int b = 0xffffffff;
a[b] = 30;
printf("%d\n", a[-1]);
a[-1] = 50;
printf("%d %d\n", a[-1],b);
}
a. Error
b. Garbage Garbage 1
c. 30 50 -1
d. -30 -50 1
e. None of the above
Tuesday, December 2, 2008
What is the output of following programme ?
main()
{
int a=500, b=100, c;
if(!a>=400)
b=300; c=200;
printf("b=%d c=%d", b,c);
}
a. b=300 c=200
b. b=100 c=garbage
c. b=300 c=garbage
d. b=100 c=200
{
int a=500, b=100, c;
if(!a>=400)
b=300; c=200;
printf("b=%d c=%d", b,c);
}
a. b=300 c=200
b. b=100 c=garbage
c. b=300 c=garbage
d. b=100 c=200
Subscribe to:
Posts (Atom)