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 |
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What are the various types of control structures in programming?
size maximum allocated by calloc()
while initialization of two dimensional arrays we can initialize like a[][2] but why not a[2][] is there any reason behind this?
explain what are pointers?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
What is a far pointer in c?
34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?
write a program to search for an element in a given array. If the array was found then display its position otherwise display appropriate message in c language
pointer_variable=(typecasting datatype*)malloc(sizeof(datatype)); This is the syntax for malloc?Please explain this,how it work with an example?
2 Answers eClerx, Excel, kenexa,
void main() { int x=25,y=32; clrscr(); x=x++ + y++; y=++x + ++y; printf("%d%d",x,y); }
What is nested structure in c?