What will be printed if we execute following program ?
#include<stdio.h>
int main()
{
float a = 0.3;
if(0.3 > a)
printf("True\n");
else
printf("False\n");
return 0;
}
OCS752 Introduction to C Programming
Quiz
•
Computers
•
Professional Development
•
Medium
Anusuya V
Used 10+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be printed if we execute following program ?
#include<stdio.h>
int main()
{
float a = 0.3;
if(0.3 > a)
printf("True\n");
else
printf("False\n");
return 0;
}
False
True False
True
None of These
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Guess the output of the program ?
#include<stdio.h>
int main()
{
int i = 1, j = 2;
if(i = 1) && if(j = 2)
printf("India is my country");
return 0;
}
Error: Undeclared identifier if
Error : Expression Syntax Error
Error: Misplaced If
No output and No Error
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
How many times loop will get executed ?
#include<stdio.h>
int main()
{
int i = 0;
while(i <= 255)
{
printf("%d", i);
i++;
}
return 0;
}
Infinite Times
255 Times
256 Times
1 Time
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Predict the output of the program ?
#include<stdio.h>
int main()
{
if(printf("ABC"))
printf("True");
else
printf("False");
return 0;
}
True
ABCFalse
ABC
ABCTrue
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Guess the output of the following program ?
#include<stdio.h>
int main()
{
int x=10;
printf("%d, %d, %d\n", x <= 10, x = 40, x >= 10);
return 0;
}
1, 1, 1
1, 40, 1
0, 40, 1
0, 1, 1
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Predict the output of the following code ?
#include<stdio.h>
int main()
{
int i = 10;
printf("%d, %d\n", ++i, i++);
return 0;
}
12, 10
12, 11
12, 12
Output may Vary from Compiler to Compiler
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the most preferred function to read a string in C?
scanf()
gets()
fgets()
strcpy()
30 questions
C BASICS
Quiz
•
Professional Development
20 questions
แบบทดสอบภาษาซี
Quiz
•
Professional Development
20 questions
Array Data Structure Quiz for Beginners
Quiz
•
Professional Development
20 questions
Operators in C language
Quiz
•
Professional Development
20 questions
C Programming Quiz
Quiz
•
Professional Development
21 questions
Java Quiz on Module 1 & 2
Quiz
•
Professional Development
20 questions
Quiz-1
Quiz
•
University - Professi...
20 questions
C CODE MASTER A
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