Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
c
« Previous
void main()
{
int a=5,b=10;
char x=1,y=0;
if(a,b,x,y)
{
printf("MAIN");
}
}
What is the output?
Options
- Nothing is printed
- MAIN is printed
- AIN is printed
- Compiler Error
CORRECT ANSWER : Nothing is printed
Discussion Board
c.c.c.
mai ccc me form dala hai
kis tarha se taiyari karo
aishan 02-27-2016 02:33 AM
Explain
In the above program if y !=0 (i.e) y equal to any value other than 0 , either positive or negative , main will be printed !
Sivaprakash G 07-15-2014 11:49 PM
c expert
in the above program in if condition if(a,b,x,y) comma operaters are used and the associativity of comma operator is from left to right since first it start with a followed by b and x but there is no effect happen and finally y only will effect the condition in this y =0 so if condition is fail here the result is nothing to print
elayaraj 10-2-2013 02:29 AM
« Previous
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
C test (42)
C (12)
C++ for beginners (10)
C++ (20)
C++ (24)
C++ (18)
C++ (14)
C++ (12)
C++ (15)
C++ (15)
Data structure (20)
Data structure (10)
Data structure (10)
Data structure (10)
PERL (25)
VC++ (11)
Oops (30)
Mainframe (41)
Mainframe (15)
Embedded systems (15)
OOAD (49)
Advertisement
▲