Quiz-1
Q 1.
What will be the output of the following C program? / निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा
#include <stdio.h>
int main(){
int a=5, b=7;
if(5<a){
printf("Delhi");
}
printf("Gurugram");
if(3<b)
printf("Banglore");
else
printf("Chennai");
else
printf("Jaipur");
}
- DelhiGurugramBanglore
- DelhiGurugram
- Jaipur
- Compile Time Error
Q 2.
What will be the output of the following C program? / निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा
#include <stdio.h>
int main(){
int a=5, b=7;
if(a<b)
if(0)
printf("FliQi");
else
printf("FliQi Education");
}
- FliQi
- FliQi Education
- Print Nothing
- Compile Time Error
Q 3.
Which of the following are incorrect statements? / निम्नलिखित में से कौन से गलत कथन हैं?
If int a=10
1) if( a==10 ) printf("IncludeHelp");
2) if( 10==a ) printf("IncludeHelp");
3) if( a=10 ) printf("IncludeHelp");
4) if( 10=a ) printf("IncludeHelp");
- 3 and 4
- 3 only
- 4 only
- 2,3 and 4
Q 4.
What will be the output of following program ? / निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?
#include <stdio.h>
int main()
{
if( (-100 && 100)||(20 && -20) )
printf("Condition is true.");
else
printf("Condition is false.");
return 0;
}
- Condition is true.
- Condition is false.
- No output
- ERROR
Q 5.
What will be the output of following program ? / निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?
#include <stdio.h>
void main()
{
int x=22;
if(x=10)
printf("TRUE");
else
printf("FALSE");
}
- TRUE
- FALSE
- Error
- None
Q 6.
Find the output of the given C program. / दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।
#include<stdio.h>
int main()
{
float a = 1.2;
if(1.2==a) printf("true");
else printf("false");
return 0;
}
- false
- error
- true
- None of these
Q 7.
Point out the errors, if any, in the following programs:
#include<stdio.h>
int main()
{
int i = 10, j = 10;
if (i && j == 10)
printf (“Have a nice day\n”);
return 0;
}
- Have a nice day
- Print Nothing
- CTE
- RTE
Q 8.
What will be the output of the following programs:
#include<stdio.h>
int main()
{
int x = 10, y=20;
if(x==y);
printf (“%d %d\n”,x,y);
return 0;
}
- 10 20
- 20 10
- Print Nothing
- Compile Time Error
Q 9.
What will be the output of the following programs:
#include<stdio.h>
int main()
{
int a = 500, b, c;
if(a >= 400)
b=300;
c=200;
printf (“%d\n”,b,c);
return 0;
}
- 300 200
- 500 300
- 300 300
- 300 500
Q 10.
What will be the output of the following programs:
#include<stdio.h>
int main()
{
int a = 300, b=400, c;
if(a >= 400)
b=300;
c=200;
printf (“%d%d \n”,b,c);
return 0;
}
- 300 300
- 300 200
- 300 400
- 400 200