NEW
Font size
WorksheetsA "C" Event-the backbone of modern coding.
Total questions: 16
Worksheet time: 8mins
What is the difference between "int" and "float" data types in C?
"int" is used for integer numbers, while "float" is used for real numbers with decimal points.
"int" is used for text, while "float" is used for numeric data.
"int" is used for single-precision floating-point numbers, while "float" is used for double-precision floating-point numbers.
There is no difference; "int" and "float" are equivalent.
What is the purpose of the "break" statement in a loop in C?
To exit the program
To skip the next iteration of the loop
To end the loop completely and continue with the next statement after the loop
To jump to a specific label within the loop
In C, what is the purpose of the "include" directive?
To include external libraries
To declare variables
To define data types
To comment out code
Which of the following is an infinite loop in C?
for (int i = 0; i < 10; i++)
while (1)
do { /* code / } while (0)
if (condition) { / code */ }
What is the purpose of the "if" statement in C?
To declare variables
To perform conditional execution
To loop through a block of code
To define a new function
What is the scope of a variable declared inside a function in C?
Global scope
Local scope
Static scope
Constant scope
What is the return type of the "int main" function in C?
void
int
char
float
what is the output of above code?
3 5
3 3
5 5
5 3
#include<stdio.h>
int main()
{
static int i=5;
if(--i){
main();
printf("%d ",i);
}
}
what is the output of above question?
Error
4
4 3 2 1
0 0 0 0
# include <stdio.h>
# define scanf "%s welcome to A "C" Event "
main()
{
printf(scanf, scanf);
getchar();
return 0;
}
what is the output of above code?
Missing of header file
%s welcome to A "C" Event
%s welcome to A "C" Event welcome to A "C" Event
welcome to A "C" Event
#include <stdio.h>
int main()
{
int c = 5, no = 1000;
do {
no /= c;
} while(c--);
printf ("%d\n", no);
return 0;
}
What is the output of above give code?
500
500
100
50
10
5
1
Error
infinite loop
int main()
{
int x, y = 2, z, a;
if (x = y % 2)
z = 2;
a = 2;
printf("%d %d ", z, x);
return 0;
}
what is the output of above code?
1 2
0 2
2 2
0 0
What is the purpose of the "void" keyword in a function declaration or definition?
To indicate that the function does not return a value.
To specify that the function is recursive
To declare a function as global.
To define a variable.
In C, what is the purpose of the "do...while" loop?
To iterate over a block of code a specific number of times.
To execute a block of code at least once before checking the condition.
To create an infinite loop.
To iterate over a block of code with a "for" loop.
What is the purpose of the "break" statement in C?
To end a program
To exit a loop or switch statement.
To skip the next iteration of a loop
To terminate a function
How much enjoy learning in this work shop?
Learned and enjoyed being in this workshop need more of this type.
Boring need something better .
Its ok to be a part of this event ,need more.
enjoyed need more workshops and events.
