Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


#include<conio.h>
#include<stdio.h>
void main()
{
int i;
if(1,0,2,3)
{
printf("if");
}
else
{
printf("else");
}
getch();
}
Can any body tell the answer of this question with explanation?

Answers were Sorted based on User's Feedback



#include<conio.h> #include<stdio.h> void main() { int i; if(1,0,2,3) { printf(&qu..

Answer / shyamkumar1221

the question might be like this
#include<conio.h>
#include<stdio.h>
void main()
{
int i=1;
intj=0,k=2,l=3;
if(i,j,k,l)
{
printf("if");
}
else
{
printf("else");
}
getch();
}
the output would be if
since in the if ()we are using comma operator.the precedence
is left to right...since in the if the we get output as 3
which is non zero.the if statement is true and if statement
will be printed

Is This Answer Correct ?    11 Yes 1 No

#include<conio.h> #include<stdio.h> void main() { int i; if(1,0,2,3) { printf(&qu..

Answer / guest

yhaa... it will print if....... okay...


why u know.... because in if condition u r not checking any
conditions... thatis why,,,,,

Is This Answer Correct ?    0 Yes 1 No

#include<conio.h> #include<stdio.h> void main() { int i; if(1,0,2,3) { printf(&qu..

Answer / prateek songara

By default "i" will posses the value 2 bcoz of "int" and when it moves to "if" it will check all the values matches with its value (1,0,2,3) and if he gets the match then it will print the "if" ..else it will print the "else"..........hope you got the answer now.

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Interview Questions

A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

0 Answers  


Program to simulate second clock

2 Answers  


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

0 Answers  


why do we use # in c-language?

1 Answers  


What is static and auto variables in c?

0 Answers  


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

0 Answers  


What is the purpose of the code, and is there any problem with it? unsigned int f( unsigned n ) { return –n & 7; }

1 Answers   Google,


How can a program be made to print the name of a source file where an error occurs?

0 Answers  


what's the return value of malloc()

9 Answers  


How can I set an array's size at run time?

9 Answers  


print 1-50 with two loop & two print Statement

2 Answers  


What is meant by 'bit masking'?

0 Answers  


Categories