ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
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
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
Answer
# 1
c) Fail1,Pass2..........
 
Is This Answer Correct ?    1 Yes 0 No
Jack
 
  Re: 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
Answer
# 2
Fail1, Pass2
 
Is This Answer Correct ?    1 Yes 0 No
Divyesh
 
 
 
  Re: 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
Answer
# 3
this program gives an error that comparison between signed 
and unsigned int
 
Is This Answer Correct ?    0 Yes 0 No
Subbu
 
  Re: 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
Answer
# 4
none
 
Is This Answer Correct ?    0 Yes 0 No
Nageswari
 
  Re: 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
Answer
# 5
pass1 fail2
 
Is This Answer Correct ?    0 Yes 0 No
Karthika
 
  Re: 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
Answer
# 6
u should not assign a negative value to unsigned int! b'coz
it has only +ve values 0to2^15-1..
 
Is This Answer Correct ?    0 Yes 0 No
Vikraman85
[Anna University!]
 
  Re: 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
Answer
# 7
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 ?    0 Yes 0 No
Madhuri
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Why doesn't the code "a[i] = i++;" work?  4
what is array? HCL22
How can I allocate arrays or structures bigger than 64K?  4
write a C code To reverse a linked list Motorola2
what is the difference between. system call and library function? CDAC2
WAP to convert text into its ASCII Code and also write a function to decode the text given?  2
Blade logic interview question. 1st round is a written tests with 15 multiple questions from c and c++. All are simple basic question. Like int main () { Int i=65; Return printf(“%c”, i); } 2nd and 3rd round is technical interview. The position for which I was interview was core UNIX and c. Yes it is for system programming. The company has product name blade server. For their server they are creating their own command for their purpose. Example cd command. We can implement it in a c program by using the chdir() function. So the question asks related to PID, fork, pipe, shared memory, signal. Write a program in c which will act as cp command. BladeLogic1
who did come first hen or agg Infosys12
helllo sir give me some information of the basic information the c as printf ,scanf , %d ,%f and why is the main use of these.  3
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student" IBM4
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator?? Verifone8
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?  2
int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i); HCL5
wats the diference btwen constant pointer and pointer to a constant.pls give examples.  6
WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c file management?  6
Struct(s) { int a; long b; } Union (u) {int a; long b; } Print sizeof(s)and sizeof(u) if sizeof(int)=4 and sizeof(long)=4 Mascot2
How can I set an array's size at run time?  7
what does the following code do? fn(int n,int p,int r) { static int a=p; switch(n){ case 4:a+=a*r; case 3:a+=a*r; case 2:a+=a*r; case 1:a+=a*r; } } a.computes simple interest for one year b.computes amount on compound interest for 1 to 4 years c.computes simple interest for four year d.computes compound interst for 1 year TCS4
print ur name without using any semicolon in c/c++....  6
what is the function of .h in #include<stdio.h> in c ? IBM9
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com