0% found this document useful (0 votes)
25 views4 pages

Epco MCQ

Epco mcq Gujarat University for nep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

Epco MCQ

Epco mcq Gujarat University for nep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Questions OptionA OptionB OptionC OptionD

scanf() function is used to take input from user TRUE FALSE


printf() function is used to display output on screen TRUE FALSE
which format string is used to scan or print an interger as signed
decimal number? %d %s %c %f

which format string is used to scan or print a floating point number? %d %s %c %f


which format string is used to scan or print a character? %d %s %c %f
which format string is used to scan or print a character string? %d %s %c %f
getchar() is buffered input function TRUE FALSE
#include preprocessor is used to include header file to a C progarm TRUE FALSE
you can define a macro in c using which preprocessor directive? #include #define A and B all
header files extention are .h TRUE FALSE
decision making statements in programming language decides the
direction of flow of program execution TRUE FALSE
which is decision making statement? if if-else switch all
We can use else statement with if statement to execute a block of
code when it's true TRUE FALSE
when an if else statement is present inside the body of another "if"
or "else" then this is called nested if else TRUE FALSE
We can use else statement with if statement to execute a block of
code when it's false TRUE FALSE
A while loop is the entry-control looping structure TRUE FALSE
While is also called exit-controlled loop TRUE FALSE
Which is also called exit-controlled loop while-loop for-loop do-while loop A and C
Do-while loop is also called entry-controlled loop TRUE FALSE
In while loop,if a condition is true then and only then the body of a
loop is executed TRUE FALSE
In do-while loop,the body of a loop is always executed at least once
even if candition is false TRUE FALSE
For loop contains 3 parts:initial value;condition;increment or
decrement TRUE FALSE
A Loop within another loop is called nested loop TRUE FALSE
In which loop ,a condition is checked before executing the body of a entry controlled exit controlled
loop loop loop A and B None
entry controlled exit controlled
In which loop,a condition is checked after executing the body of loop loop loop A and B None
Which statement is used to teminate the execution of the rest of the
block break goto exit continue
Which statement used to tranfer the control to the beginning of the
loop skipping the remaining statements inside the loop break goto exit continue
Which statement is used to tranfer the flow of control to any part of
the program break goto exit continue
Which statement is used to terminate the currently running
program(process) immediately break goto exit continue
Array is a collection of elements of single datatye TRUE FALSE
First element of array located at which index? 0 1 2 3
two one multi
Which array can be imagined as a matrix or table of row and dimensional dimensional dimensional
columns? array array A and B array
Array is a collection of elements of multiple datatype TRUE FALSE
String is also called "character array" TRUE FALSE
String is enclosed within which quotes In C? double quotes single quotes A and B All
String always terminated with NULL character('\0') TRUE FALSE
name[5]="LJCCA" ,which character in name[1]? L J C A
It is possible to access individual character in string TRUE FALSE
User defined functions are block of codes to perform specific tasks
and return the result TRUE FALSE
The functions which are developed by user at the time of writing a
program are called user defined function TRUE FALSE
How many categories of user defined functions? 1 2 3 4

function with no function with function with no function with


Which functions can either be used to display informtion or they are argument and argument and argument and argument and
completely dependent on user input? no return value no return value return value return value

function with no function with function with no function with


Which function completely independent of input and output,and argument and argument and argument and argument and
only the logic is defined inside the function body? no return value no return value return value return value
A function called itself is called Recursion. TRUE FALSE
Who are used to describe the features of a variable/function? Storage classes header files A and B None
The lifetime of a variable is the time period in which the variable has
valid memory. TRUE FALSE
What happens when the code shown below is executed?
#include<stdio.h>
int main()
{
printf("Hello");
main();
return 0;
} Hello is printed Hello infinite Hello is not
once number of times printed at all 0 is returned
What is the output of the following code?
#include<stdio.h>
main()
{
int n=10;
int f(int n);
printf("%d",f(n));
}
int f(int n)
{
if(n>0)
return(n+f(n-2));
} 10 80 30 Error
How many times is ‘a’ printed when the code given below is
executed?
#include<stdio.h>
main()
{
int a;
a=f1(10);
printf("%d",a);
}
f1(int b)
{
if(b==0)
return 0;
else
{
printf("a");
f1(b--);
} Infinite number
} 9 times 10 times 0 times of times
What is the output of the following code?
#include<stdio.h>
main()
{
int n;
n=f1(4);
printf("%d",n);
}
f1(int x)
{
int b;
if(x==1)
return 1;
else
b=x*f1(x-1);
return b;
}
24 4 12 10

You might also like