What is the result
main()
{
char c=-64;
int i=-32
unsigned int u =-16;
if(c>i){
printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}
a)Pass1,Pass2
b)Pass1,Fail2
c)Fail1,Pass2
d)Fail1,Fail2
e)none
Answers were Sorted based on User's Feedback
Answer / madhuri
here int i=-32 is not terminated so syntax error
if that statement was terminated then the answer would be
none in the given options because the output of the program
would be
pass1
pass2
pass2
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / bishnu agrawal
it is an error bcoz u can assing a signed value to unsigned variable so answer is null
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / subbu
this program gives an error that comparison between signed
and unsigned int
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / vikraman85
u should not assign a negative value to unsigned int! b'coz
it has only +ve values 0to2^15-1..
| Is This Answer Correct ? | 1 Yes | 2 No |
What is scope rule of function in c?
What is size of union in c?
in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n
What is the use of header?
Explain the properties of union.
how to swap 4 number without using temporary number?
Sir i want e-notes of C languge of BAlaguruswami book i.e scanned or pdf file of balaguruswamy book on c language.PLEASE SEND ME on my mail id ajit_kolhe@rediff.com
main() { int i=5; printf("%d%d%d%d",i++,i--,i); }
difference between c and c++?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
When is a “switch” statement preferable over an “if” statement?
Convert the following expression to postfix and prefix (A+B) * (D-C)