Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

C Programming :: Variables & Data Types

Home > C Programming > Variables & Data Types > General Questions

21. What will be output of the following "c" code?

#include
int main(){
printf("%c",*"abcde");
return 0;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

22. What will be output of the following "c" code?

#include
int main()
{
register a,b,x;
scanf("%d %d",&a,&b);
x=a+~b;
printf("%d",x);
return 0;
}
=> For Input 2 3

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option E

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

23. What is the output of the following program?

#include
void main()
{
float a= 0.7;
if (a<0.7)
printf("C");
else
printf ("C++");
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

24. What will be output of the following "c" code?

#include
void main()
{
int k=ret(sizeof(float));
printf("\n here value is %d",++k);
}
int ret(int ret)
{
ret += 2.5;
return(ret);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

The int ret(int ret), ie., the function name and the argument name can be same.
Firstly, the function ret() is called in which the sizeof(float) ie., 4 is passed, After the first expression the value in ret will be 6, as ret is integer hence the value stored in ret will have implicit type conversion from float to int.
The ret is returned in main() it is printed after and pre-increment.

Workspace

Tags:

No Tags on this question yet!

25. What will be output of the following "c" code?

#include
void main()
{
unsigned n=-1;
int x;
printf("%u ",++n);
printf("%u ",x=--n);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

26. What will be output of the following "c" code?

#include
void main()
{
unsigned int i=10;
while(i-- >=0)
printf("%u",i);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Since i is an unsigned integer it can never become negative. So the expression i-- >=0 will always be true, leading to an infinite loop.

Workspace

Tags:

No Tags on this question yet!

27. What will be output of the following "c" code?

#include
void main()
{
float f=5;
printf("%f",f<<2);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Bit-wise operators and % operators cannot be applied on float values.

Workspace

Tags:

No Tags on this question yet!

28. What will be output of the following "c" code?

#include
#include
void main()
{
float f=5,g=10;
printf("%lf",f%g);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Bit-wise operators and % operators cannot be applied on float values.

Workspace

Tags:

No Tags on this question yet!

29. What will be output of the following "c" code?

#include
void main()
{
unsigned char i=0;
for (;i>=0;i++)
printf("%d",i);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

char is declared to be unsigned. So the i++ can never yield negative value and i>=0 never becomes false so that it can come out of the for loop.

Workspace

Tags:

No Tags on this question yet!

30. What will be output of the following "c" code?

#include
void main()
{
int i=5,j=10;
i=i&=j&&10;
printf("%d %d",i,j);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

The expression can be written as i=(i&=(j&&10));
The inner expression (j&&10) evaluates to 1 because j==10. i is 5. i = 5&1 is 1.

Workspace

Tags:

No Tags on this question yet!