What will be the output of the following C code?
#include <stdio.h>
void m()
{
printf("hi");
}
void main()
{
m();
}
CPR_Quiz_Chapter4_function
Quiz
•
Professional Development
•
Professional Development
•
Medium
Sheetal Pawar
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following C code?
#include <stdio.h>
void m()
{
printf("hi");
}
void main()
{
m();
}
hi
Run time error
Nothing
Varies
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
the value obtained in the function is given back to main by using ________ keyword.
return
static
new
volatile
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which function definition will run correctly?
int sum(int a, int b)
return (a + b);
int sum(int a, int b)
{return (a + b);}
int sum(a, b)
return (a + b);
none of the mentioned
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
void can be used
as a data-type of a function that returns nothing to its calling environment
inside the brackets of a function that does not need any argument
in an expression
both (a) & (b)
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Any C program
must contain at least one function
need not contain any function
needs input data
none of the above
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The following program
main ()
{ int a = 4;
change { a };
printf ("%d", a);
}
change (a)
int a;
{
printf("%d", ++a);
}
55
.45
54
44
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following function calculates the square of 'x' in C?
sqr(x)
pow(2, x)
pow(x, 2)
power(2, x)
16 questions
UC_TM02_C Programming Basics
Quiz
•
University - Professi...
20 questions
HACKATHON HUSTLE(ROUND 2)
Quiz
•
Professional Development
10 questions
pemrograman dasar
Quiz
•
Professional Development
10 questions
CPR Quiz_chapter 5_structure
Quiz
•
Professional Development
20 questions
C Quiz 1
Quiz
•
Professional Development
20 questions
SJIT ECE PRACTICE TEST HCL @ 13/3/24
Quiz
•
Professional Development
15 questions
Tutorial 1 Chapter 4 C Programming
Quiz
•
Professional Development
10 questions
DAY 1 - C& C++ Assessment _10th June 24
Quiz
•
Professional Development
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade