stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
C programming quiz Flashcards | StudBud
Explore
/
C programming quiz
C programming quiz
20 terms
·
StudBud Administration
·
20 plays
Imported from external platform
Flashcards
20 cards
F
Practice quiz
P
Host live
L
Questions
20
Answers
1
How do you start writing a for loop in C?
for(i=0;i<5;i++)
for(i=0;switch i<5;i++)
for(i=0;while i<5;i++)
for()x in y
2
Which keyword is used to create a structure?
struct
structure
str
structs
3
What is the difference between a while loop and a do-while loop in C?
while loop checks the condition before execution, do while checks after
while loop checks checks the condition after execution
while loop is used for input and do while for calculations
there is no difference
4
In C programming , which of the following header file is used for performing mathematical operations?
math.h
stdio.h
conio.h
string.h
5
Which operator can be used to find the memory size (in bytes) of a data type or variable?
len()
sizeof()
length()
sizer()
6
Array indexes start with:
0
1
-1
all of the above
7
Which operator can be used to compare two values?
>>
=
<<
==
8
What is a correct syntax to output "Hello World" in C?
System.out.println("Hello World";)
Console("Hello World";)
printf("Hello World");
cout << "Hello World";
9
Which of the following is a logical AND operator?
&&
None of the above
!
||
10
What will be the output of the following C code?
Compilation error
Hello
Hello World
Hi World
11
Which keyword is used to return a value inside a function?
break
void
get
return
12
What do we call the following? int myNumbers[] = {25, 50, 75, 100};
An array
a pointer
a class
none of the above
13
Which statement can be used to select one of many code blocks to be executed?
when
switch
break
default
14
Which function is often used to output values and print text?
print();
output();
printword();
printf();
15
Which of the following is the correct way to declare a pointer variable in C?
int ptr;
ptr int;
int *ptr;
*ptr;
16
How do you call a function in C?
(myfunction);
myfunction;
myfunction[];
myfunction();
17
Which format specifier is often used to print integers?
%d
%f
%s
%c
18
How can you create a variable with the numeric value 5?
int num=5;
val num=5;
num=5 int;
num=5;
19
When a variable is created in C, a memory address is assigned to the variable.
False
True
20
In C, code statements must end with a semicolon (;)
False
True