
CP_Quiz_19Apr2023
Authored by A M Abirami
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Identify the compilation errors in the given C program
& operator is missing in scanf()
Semicolon is used for the case label M, instead of colon
No single quote is used for the case label T
break statement is missing in second case block
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Guess the output correctly
A 65 65 A
A 65 65 65
A 65 A 65
Error
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
int main()
{
int x[ ][4] = {10, 20, 30, 40, 50, 60};
printf("%d \n %d", x[1][1], x[1][2]);
}
First it prints 60, then prints either 0 or Garbage value
Error, as array initialization is wrong
Prints 60 only
First it prints 40, then prints either 0 or Garbage value
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Assume the size of int is 4 bytes. if the base address of array is 4210, then the address of 7th element is __________
4234
4238
4230
4217
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Identify the correct 1D, 2D array initialization
int a[ ] = {10, 20};
int a[ ][ ] = {10, 20};
int a[ ][2] = {10, 20};
int a[10] = {10, 20};
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
float array is initialized as follows: float x[ ] = {3.2, 2.3, 4.3, 3.4, 4}. Identify the option when the statement printf("%f",x[4]); is executed.
4.000000
4
Error, as float array cannot have int item
4.0
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Identify the Output when the given C code, containing the Bitwise Operation, is executed:
int main()
{
int a = 5;
int b = 6;
printf("%d %d", a & b, a | b);
}
4 7
7 4
0 1
Operations are Not possible
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?