CNIT 105 QUESTIONS AND 100%
CORRECT ANSWERS | 2025
Which of the following is the standard way to print a character variable c; char c =
'C';
printf("%d", c);
printf("%c", c);
printf("%s", c);
printf("%c", &c); - ANSWER printf("%c", c);
What is the extension of the source file of 'c' program?
.exe
.obj
.c
.cpp - ANSWER .c
Which of the following is the standard way to scan a float variable x?
float x;
scanf("%f", &x);
, scanf("%.2f", &x);
scanf("%d", &x);
scanf("%f", x); - ANSWER scanf("%f", &x);
In a C program, the execution begins with which function?
main ( ) function
Doesn't matter
First function in the program
There is no function in c program - ANSWER main ( ) function
When you don't want the function to return anything which of the following
return type will you use?
int
void
Nothing
float - ANSWER void
Which of the following option is a prototype of the given function?
int divide(int a, int b) {
return a / b
CORRECT ANSWERS | 2025
Which of the following is the standard way to print a character variable c; char c =
'C';
printf("%d", c);
printf("%c", c);
printf("%s", c);
printf("%c", &c); - ANSWER printf("%c", c);
What is the extension of the source file of 'c' program?
.exe
.obj
.c
.cpp - ANSWER .c
Which of the following is the standard way to scan a float variable x?
float x;
scanf("%f", &x);
, scanf("%.2f", &x);
scanf("%d", &x);
scanf("%f", x); - ANSWER scanf("%f", &x);
In a C program, the execution begins with which function?
main ( ) function
Doesn't matter
First function in the program
There is no function in c program - ANSWER main ( ) function
When you don't want the function to return anything which of the following
return type will you use?
int
void
Nothing
float - ANSWER void
Which of the following option is a prototype of the given function?
int divide(int a, int b) {
return a / b