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   To Refer this Site to Your Friends   Click Here
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
int i;
     i=2;
     i++;
     if(i=4)
     {
     printf(i=4);
     }
     else
     {
     printf(i=3);
     }
     output of the program ?  
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 1
the output will b 4.
 
Is This Answer Correct ?    0 Yes 4 No
Fazlur
[Depik Technologies.]
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 2
It will give segmentation fault in linux
 
Is This Answer Correct ?    4 Yes 2 No
Fwfwgq
 
 
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 3
output is 3
 
Is This Answer Correct ?    3 Yes 0 No
Sathish
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 4
output of this program is  3
 
Is This Answer Correct ?    4 Yes 1 No
Jignesh Patel
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 5
output
3
 
Is This Answer Correct ?    2 Yes 1 No
Ssssssssss
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 6
There Wont be any output for this program.It will show 
error.Because 1:inside if "=" is used.2:"printf" cant print 
the value
 
Is This Answer Correct ?    4 Yes 0 No
Akbar Shan
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 7
outout will be 4 in case code is printf("i=4");
printf("i=3");
else this program will show two error
 
Is This Answer Correct ?    1 Yes 1 No
Ruchi
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 8
answer is three
 
Is This Answer Correct ?    0 Yes 2 No
Gowtham
 
  Re: int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
Answer
# 9
The conditional test if(i=4) is true for evrey non zero 
value of i.As here i=3 here execute the if statement.But 
printf can't print nothing because we have not mation the 
proper syntax of printf.if we replace 
  printf(i=4)by printf("i=4")
it will give the following output:
    i=4
 
Is This Answer Correct ?    1 Yes 0 No
Asit Mahato
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
#define f(x) main() { printf("\n%d",f(2+2)); }  3
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]  2
how to find out the biggest element (or any other operation) in an array which is dynamic. User need not to mention the array size while executing.  2
Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;  7
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+.... Ignou2
How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal) Subex1
Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc  2
a C prog to swap 2 no.s without using variables just an array? TCS4
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice) Subex1
what are the uses of structure? HCL5
2. Counting in Lojban, an artificial language developed over the last fourty years, is easier than in most languages The numbers from zero to nine are: 0 no 1 pa 2 re 3 ci 4 vo 5 mk 6 xa 7 ze 8 bi 9 so Larger numbers are created by gluing the digit togather. For Examle 123 is pareci Write a program that reads in a lojban string(representing a no less than or equal to 1,000,000) and output it in numbers. Nagarro2
size maximum allocated by calloc() DELL1
Which of these statements are false w.r.t File Functions? i)fputs() ii)fdopen() iii)fgetpos() iv)ferror() A)ii B)i,ii C)iii D)iv Accenture5
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2) Subex2
which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..} TCS2
How to avoid structure padding in C? Tech-Mahindra4
how to find the binary of a number? Infosys5
pgm to reverse string using arrays i.e god is love becomes love is god) (assumption:only space is used for seperation of words) no addtional memory used.i.e no temporary arrays can used. Persistent4
Define function ?Explain about arguments? Geometric-Software2
what is difference b/w extern & volatile variable?? Teleca2
 
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