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 the output of printf("%d", printf("Hello"));?
Write a function that accepts a sentence as a parameter, and returns the same with each of its words reversed. The returned sentence should have 1 blank space between each pair of words. Demonstrate the usage of this function from a main program. Example: Parameter: “jack and jill went up a hill” Return Value: “kcaj dna llij tnew pu a llih”
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
What are the types of c language?
Explain the use of function toupper() with and example code?
how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y
wat s the meaning of (int *)p +4;
Explain can you assign a different address to an array tag?
write a 'c' program to sum the number of integer values
Find greatest number out of 10 number without using loop.
what is the difference between getch() and getchar()?
Do character constants represent numerical values?