Ques 1 If Else
What is the output of the following code?
int main()
{
int i=1;
if(i=='1')
{
printf("i=1");
}
else
{
printf("i is not equal to '1'");
}
return 0;
}
a) i='1'
b) i is not equal to '1'
c) Syntax error
d) None of these
Ques 2 If Else
What is the output of the following code ?
int main()
{
int i;
if(i)
printf("SmallCode");
else
printf("Hello SC User");
return 0;
}
a) Hello SC User
b) Error
c) Logical Error
d) SmallCode
Ques 3 If Else
What is the output of the following code ?
int main()
{
int i=10;
if(i<1)
printf("SmallCode");
if
printf("Hello SC User");
return 0;
}
a) Hello SC User
b) Syntax Error
c) Logical Error
d) SmallCode
Ques 4 If Else
What is the output of the following code ?(DEV C++)
int main()
{
char i="i";
if(i)
printf("SmallCode");
else
printf("Hello SC User");
return 0;
}
a) Hello SC User
b) Error
c) Logical Error
d) SmallCode
Ques 5 If Else
What is the output of the following C Code?
#include<stdio.h> int main() { int year = 2022; int year = 2023; printf("Year : %d\n", year); return 0; }