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 |
void main() { //char ch; unsigned char ch; clrscr(); for(ch =0;ch<= 127; ch++) printf(" %c= %d \t ", ch, ch); } output?
Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a)); printf("\nSize of 2.0 ::%d",sizeof(2.0));}
11 Answers IBM, TCS,
Why is C language being considered a middle level language?
How do I copy files?
Convert the following expression to postfix and prefix (A+B) * (D-C)
All technical questions
25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumour continues. Find how many minutes does it take spread the rumour to 768 persons. ?
11 Answers CTS, TCS,
what are far pointers?
Give differences between - new and malloc() , delete and free() ?
How can I remove the leading spaces from a string?
application of static variables in real time
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā%dā,s.x); }