C Output Questions
- Find Error/Output in follwing code:
- No Output
- True
- False
- Error because of dangling else problem
int main() {
int x = 0, y = 0;
if(x > 0)
if(y > 0)
printf("True");
else
printf("False");
}
Added By : Sachin
- Find Error/Output in follwing code:
- Syntax error due to Invalid expression in printf
- Print junk value
- 16
- 10
main() {
int i = 2, *j;
j = &i;
printf("%d", i**j*i+*j);
}
Added By : Seema Jain
- Find Error/Output in follwing code:
- 0
- Error because of incorrect line-1 only.
- Error because of incorrect line-1 and line-2.
- Error because of incorrect line-2 only.
int main() {
int x,y,z;
x = '1'-'0'; /* line-1 */
y = 'a'-'b'; /* line-2 */
z = x + y;
printf("%d",z);
}
Added By : Kritika Garg
- Find Error/Output in follwing code:
- a = 11 b = 21 a = 11 b = 22
- a = 11 b = 21 a = 11 b = 22
- a = 11 b = 21 a = 11 b = 22
- a = 11 b = 21 a = 11 b = 22
void fn() {
int a = 10;
static int b = 20;
printf("a = %d b = %d", ++a, ++b);
}
int main() {
fn();
fn();
return 0;
}
Added By : Prachi Gupta
- Find Error/Output in follwing code:
- a
- 0x56FA
- m
- y
void main ( )
{
char *P = "ayqm" ;
char c;
c = ++*p ;
printf ("%c", c);
}
Added By : Sumit
- Find Error/Output in follwing code:
- 101010
- 100xaa54f10
- Run time error
- No Output
void main()
{
int x=10,*y,**z;
y=&x;
z=&y;
printf(\"%d%d%d\",*y,**z,*(*z));
}
Added By : Abhishek Mishra
- Find Error/Output in follwing code:
- No Output and No Error
- EXAM
- Run time error
- Compile time error
void main()
{
int a = 1, b=2, c=3;
char d = 0;
if(a,b,c,d)
{
printf("EXAM");
}
}
Answer :
A
Explanation:
Print statement will not execute because if condition return false. Value of variable d is 0.
Added By : Amit Jain
- Find Error/Output in follwing code:
- EXAM
- No Output
- Run time error
- None of the above
void main()
{
int a = 1, b=2, c=3;
if(a,b,c)
{
printf("EXAM");
}
}
Added By : Dheeraj Singh
Also Exercise
Post Your Question
Social Sharing
Search
Articles
Recently Added Jobs
Rajasthan High Court - Jodhpur Recruitment 2017 for Civil Judges
Last Date: 21 December, 2017
Last Date: 21 December, 2017
WBSEDCL Recruitment - 2017 for Office Executive
Last Date: 16 May, 2017
Last Date: 16 May, 2017
RECRUITMENT OF PROBATIONARY OFFICERS IN STATE BANK OF INDIA
Last Date: 06 March, 2017
Last Date: 06 March, 2017
UPSC Combined Medical Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015
UPSC Engineering Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015