NEW
Font size
WorksheetsC function
Total questions: 17
Worksheet time: 10mins
A function that has no return type starts with:
int
void
Arguments
Braces
True or False. We can call functions inside of other functions.
True
False
How many times will the program print "SRM"
#include<stdio.h>
int main()
{
printf("SRM");
main();
return 0;
}
Zero
till stack overflows
Error
-1
What is the output of this C code?
void m()
{
printf("hi");
}
void main()
{
m();
}
hi
runtime error
none
hi hi
How many values can a C Function return at a time.?
1
As many
None
Max of 3 values
int show();
void main()
{
int a;
a=show();
printf("%d", a);
}
int show()
{
return 15.5;
return 35;
}
35
15.5
15
None
Which of the following can never be sent by call-by-value?
a) Variable
b) Array
Integer
Float
Arguments that take input by user before running a program are called?
Main function arguments
Main arguments
Command-Line arguments
Parameterized arguments
What are mandatory parts in function declaration?
return type,function name
return type,function name,Parameters
none
Function name
What will be the output of the following code?
void main()
{
fun();
}
void fun()
{
static int x=3;
printf(“%d ”,x);
if(--x)
fun();
}
Error in code
3 2 1
3 2 1 0
3 3 3
Infinite loop
What is the output of the below code?
#include <stdio.h>
int main()
{
printf("%d", main);
return 0;
}
Address of main function
Compiler Error
Runtime Error
Some random address
Choose correct statement about Functions in C Language.
A Function is a group of c statements which can be reused any number of times.
Every Function has a return type.
Every Function may no may not return a value.
All the above.
Choose a correct statement about C Function.?
main()
{
printf("Hello");
}
"main" is the name of default must and should Function.
main() is same as int main()
By default, return 0 is added as the last statement of a function without specific return type.
All the above
Self FunctionA function which calls itself is called a ___ function.
Self Function
Auto function
Recursive function
Static function
What is the output of C Program with functions.?
int main() {
show();
printf("BANK ");
return 0;
}
void show()
{ printf("CURRENCY ");
}
CURRENCY BANK
BANK CURRENCY
BANK
compiler error
What are types of Functions in C Language?
Library
user defined
Both
none of the above
Choose a correct statement about C language arrays.
An array size can not changed once it is created.
Array element value can be changed any number of times
To access Nth element of an array students, use students[n-1] as the starting index is 0.
All the above
