NEW
Font size
WorksheetsC que que que
Total questions: 23
Worksheet time: 12mins
What is the purpose of the 'sizeof' operator in C programming?
To return the size of a variable
To calculate the sum of two numbers
To compare two strings
To print the address of a variable
Explain the syntax for declaring a pointer in C.
int *ptr;
int ptr;
*int ptr;
ptr int;
What is the purpose of the 'continue' statement in C programming?
To exit the loop or switch statement
To skip the current iteration and move to the next
To print a line break in the output
To terminate the program
Explain the difference between '++i' and 'i++' in C programming.
'++i' is pre-increment and 'i++' is post-increment.
'++i' is post-increment and 'i++' is pre-increment.
Both '++i' and 'i++' are used for the same purpose.
Give the output of the given code.
-10, 0
-9, -9
-7, 0
-10, -9
Explain the concept of 'Pointers' in C programming.
Pointers are used to store the address of other variables.
Pointers are used to store the value of other variables.
Pointers are used to perform arithmetic operations.
What is the purpose of the 'break' statement in C programming?
To exit the loop or switch statement
To skip the current iteration and move to the next
To print a line break in the output
To terminate the program
Choose the correct option for recieving an input in Line 7.
Store the Input in variable "a".
scanf("%d", &x);
scanf("%d", x);
scanf("%d", *x);
scanf("%d", *a);
What is the purpose of the 'void' keyword in C programming?
To declare a function that returns no value
To declare a function that returns an integer
To declare a function that returns a pointer
To declare a function that returns a character
Choose the correct Syntax.
For a Sum Function taking two Integer arguments "a" & "b".
int Sum (int a , int b);
Sum (a ,b);
void Sum (int a+ int b);
int Sum(int a)(int b);
What will be the output of the following code?
10
17
15
18
Debug the following code:
Note:
Following is a code for checking if a following number is a pallindrome.
Case 1-
Sample Input:
232
Sample Output:
Pallindrome: Yes
Case 2-
Sample Input:
2234
while(num>0)
while(temp>0)
while(temp<0)
while(num<0)
Debug the following code:
Note:
Following is a code for checking if a following number is a pallindrome.
Case 1-
Sample Input:
232
Sample Output:
Pallindrome: Yes
Case 2-
Sample Input:
2234
rev=rev + dig*10;
rev=rev*10 + temp;
rev=rev + temp*10;
rev=rev*10 + dig;
Debug the following code:
Note:
Following is a code for checking if a following number is a pallindrome.
Case 1-
Sample Input:
232
Sample Output:
Pallindrome: Yes
Case 2-
Sample Input:
2234
printf("Palindrome: %s", rev==num?"Yes":"No");
printf("Palindrome: %s", rev==num:"Yes"?"No");
printf("Palindrome: %s", "Yes":"No"?rev==num);
printf("Palindrome: %s", "No":"Yes"?rev==num);
'C is a structured programming language'. Why?
Function & Stuctures
Classes & Objects
Arguments & Parameters
Libraries & Modules
What does the 'f' stand for, in 'scanf' ?
Formatted
File
Format
Function
Which of the following is 'Exit Controlled'?
while Loop
do while Loop
for Loop
None
What is the correct syntax of initializing a 2d array in C?
int arr[10,10];
int arr[10][10];
int arr[[10]];
int arr[arr[10]];
What does the expression '8>>2' evaluate to?
4
2
10
6
What is the output of the following code snippet?
int x = 5, y = 10;
printf("%d", x++ + y);
15
16
14
11
Give the output of the code.
2
5
3
4
What is the Output of the Code?
Value of variable: 1
Value of variable: 0
error: variable not defined
none
How can you declare and initialize a structure variable 'book' in a single line?
struct book = { "Title", 2023, 15.99 };
struct Book { "Title", 2023, 15.99 };
struct book { title: "Title", year: 2023, price: 15.99 };
struct Book book = { "Title", 2023, 15.99 };
