int main() { unsigned int i=65000; while ( i++ != 0 ); printf("%d",i); return 0; }
PREDICT THE OUTPUT OR ERROR
TECHNICAL C PROGRAM
Quiz
•
Computers
•
University
•
Hard
GOWSIKRAJA P
Used 130+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
int main() { unsigned int i=65000; while ( i++ != 0 ); printf("%d",i); return 0; }
PREDICT THE OUTPUT OR ERROR
1
2
3
SYNTAX ERROR
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
short i;
for (i = 1; i >= 0; i++)
printf("%d\n", i);
}
STATE THE OUTPUT
The control won’t fall into the for loop
Numbers will be displayed until the signed limit of short and throw a runtime error
Numbers will be displayed until the signed limit of short and program will successfully terminate
This program will get into an infinite loop and keep printing numbers with no errors
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
#include <stdio.h>
void main() {
int array[30], temp[30], i, j, k, l, num; //using 2 arrays
printf("Enter the number of lines to be printed: "); scanf("%d", &num);
temp[0] = 1;
array[0] = 1;
for (j = 0; j < num; j++)
printf(" "); printf(" 1\n");
for (i = 1; i < num; i++)
{ for (j = 0; j < i; j++)
printf(" ");
for (k = 1; k < num; k++)
{ array[k] = temp[k - 1] + temp[k];
} array[i] = 1; for (l = 0; l <= i; l++)
{ printf("%3d", array[l]);
temp[l] = array[l];
} printf("\n");
}
}
Enter the number of lines to be printed: 4
1
1 1
1 2 1
1 3 3 1
Enter the number of lines to be printed: 4
1
1 1
1 1 1
1 1 1 1
Enter the number of lines to be printed: 4
*
* *
* * *
* * * *
Enter the number of lines to be printed: 4
1
2 2
3 3 3
4 4 4 4
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
void main() { char a = 'a'; int x = (a % 10)++; printf("%d\n", x); }
GUESS THE OUTPUT
Grabage Value
Compiler Error
Output: 10
Output: 0
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
void main() {
int k = 0;
for (k < 3; k++)
printf("Hello");
}
Compile time error
Hello is printed thrice
Nothing
Varies
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++)
printf("Hello");
}
Run time error
Hello is printed thrice
Hello is printed twice
Hello is printed infinitely
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
int i = 0;
for (; ; ;)
printf("In for loop\n");
printf("After loop\n");
}
a) Compile time error
b) Infinite loop
c) After looP
d) Undefined behaviour
15 questions
Common errors in C programming
Quiz
•
University
8 questions
Quiz - 1
Quiz
•
University
10 questions
Basics of C
Quiz
•
University
15 questions
C Language Quiz-1
Quiz
•
University - Professi...
9 questions
IPC144 SLG -- Week2
Quiz
•
University
8 questions
Unit 3 C Pro P1
Quiz
•
University
13 questions
C programming-1
Quiz
•
University
10 questions
Array in C
Quiz
•
University
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