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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   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
main()
{
	int a=0;
	if(a=0) printf("Ramco Systems\n");
	printf("India\n");
}
output?
 Question Submitted By :: Naveed
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
Answer
# 1
Ramco Systems
India
 
Is This Answer Correct ?    2 Yes 3 No
Yogendra Jain
 
  Re: main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
Answer
# 2
The output will produce error because there is error at if
(a=0).It should be if(a==0)
 
Is This Answer Correct ?    4 Yes 4 No
Ripal
 
 
 
  Re: main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
Answer
# 3
actually the output will b : India only.
the above programme doesn't produce any error at if(a = 
0).because we r assiging value here, we r not comparing the 
value here.so the condition will fail here and the next 
statement after if condition will print.
 
Is This Answer Correct ?    4 Yes 0 No
Fazlur Rahaman Naik
 
  Re: main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
Answer
# 4
the answer will be India
if statement executes the statement if it is true i.e other 
than "0"..[eg.if(1)]
here we are giving a=0 which implies false.
so the if statement doesnot execute first statement.
if you dont agree check following
main()
{
int a=0;
if(a=1)/*other than zero any number*/
printf("Ramco Systems\n")
printf("India\n");}
 
Is This Answer Correct ?    4 Yes 0 No
Vikesh
 
  Re: main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
Answer
# 5
only india will be printed ...........
 
Is This Answer Correct ?    4 Yes 1 No
Shivangi
 
  Re: main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
Answer
# 6
Actually compile time err wil occur..
Its "Possibly incorrect assignment"
Its due to if(a=0)??
Its wrong,we have to compare only while checking 
conditions..
we have to use the operators which are used to check 
conditions like ==,<=,>=....
 
Is This Answer Correct ?    0 Yes 2 No
Vikramanj
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Write a program that takes three variables(a,b,c) in as separate parameters and rotates the values stored so that value a goes to b,b,to c and c to a  3
write a program in c language for the multiplication of two matrices using pointers? Ignou5
How can we see the Expanded source code and compiled code for our source program in C?  1
what are the various memory handling mechanisms in C ? HP3
what is disadvantage of pointer in C Tech-Mahindra5
what is op? for(c=0;c=1000;c++) printf("%c",c); Trigent18
how to find turn around time in operating system?  1
write a program to compare 2 numbers without using logical operators? IBM1
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } ME5
plz answer.. a program that takes a string e.g. "345" and returns integer 345  3
why r u join this company? give solid resons. Infosys7
Tell us the difference between these two : #include"stdio.h" #include<stdio.h> define in detial.  4
What does extern mean in a function declaration?  2
What is the difference between constant pointer and pointer to a constant. Give examples. TCS3
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[] Hughes4
CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.  6
what is memory leak?  3
Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?  1
What are bit fields? What is their use? Adobe1
write a program to swap bits in a character and return the value prototype of function char fun (char a, charb flag c) where fun returns a char, char a is a the value char b is the bit to be changed and flag c is the bit value for eg: x=fun(45,7,0) since 45 is 0010 0101 and ow x should contain the value 65 (0110 0101) Bosch1
 
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