
C basics
Authored by Jeyantha 2696
Computers
University
Used 7+ 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 CHOICE QUESTION
30 sec • 1 pt
You need to store the number of students and their average marks. Which declaration is best?
float students; int avgMarks;
int students; float avgMarks;
char students; float avgMarks;
double students; char avgMarks;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is wrong with this program?
scanf should use %d instead of %f
age should be float
printf should come after scanf
No error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code?
10
20
1
0
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
This code compiles but crashes: What’s wrong?
Wrong format specifier
Missing return statement
scanf missing & operator
Cannot read two inputs
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why does this code compile but produce no output?
No input
main is empty
printf() is missing
Code is invalid
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are identifiers in C?
Names used to identify variables, functions, arrays, etc.
Special symbols used to perform operations
Predefined keywords in the C language
Numbers used for looping
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What number will z in the sample code given below?
int z, x = 5, y = -10, a = 4, b = 2;
5
6
9
10
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?