
Revision Test
Quiz by ibrahim shabbir (SGA)
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
A program outputs the word Hello upon its execution. The minimum number of functions that must be used in this program is
When a program file named FirstProgram is compiled, then it has different extensions at different stages of the compilation process.
The correct sequence of processing of this file on the basis of extensions at different stages is
The data type that should be used to store the home address of a person is
For getch( ) function, the TRUE statement is that
Read the given program
#include<stdio.h>
void main( )
{
int a = 5;
int b = 10;
if (a > 5 || b > 10)
printf("%d", a * b);
else
printf("%d", b / a);
}
The output of the given code is
To display the value 12.670000 stored in a variable, the format specifier that should be used is
The number of bytes required to store the value of variable a = 10 is
Read the given program
#include<stdio.h>
int main( )
{
int a =10, ans = 0;
for (int j = 1; j<=a; j++)
{
if ( j % 2 == 0 && j % 5 == 0)
ans++ ;
}
printf("Answer: %d" , ans);
return 0;
}
The output of this program is
Consider the given program
#include<stdio.h>
void main ()
{
float a = 1244.6713877;
printf ("%4f\n", a);
}
The output of this program is
In switch statement, if the switch variable does not match any of the case constants, then controls goes to the
Consider the given statement.
int X = 9/2
Upon execution of this statement, which of the following values will be stored in X?
Consider the given algorithm.
Step 1: Start
Step 2: INPUT W
Step 3: X = 2, Y =3
Step 4: X = X * Y
Step 5: Y = X + Y
Step 6: PRINT Pakistan
Step 7: IF X<=W THEN GOTO Step 4
Step 8: Stop
If the input is 50, then the number of times word Pakistan printed will be
Which statement is equivalent to "k = k +a"; ?
What will be the output of the given code
#include<stdio.h>
void main(void)
{
int x, y, z1, z2, z3, z4;
x = 17;
y = 5;
z1 = x/y;
printf ( "\n z1 = %d", z1);
z2 = x%y;
printf ( "\n z2 = %d", z2);
z3 = x++;
printf ( "\n z3 = %d", z3);
z4 = y++;
printf ( "\n z4 = %d", z4);
}
What will be the output of the following code?
#include<stdio.h>
void main (void)
{
int b;
float a,c,d,e,f;
a =14.84;
b = 7;
c = a-b;
printf("\nc = %f" , c);
d = a/b;
printf("\n d = %f" , d);
e = a-b*3;
printf("\n e = %f", e);
f = (a+b)/2;
printf("\n f = %f" , f);
}
Consider the given code
#include<stdio.h>
void main(void)
{
int n, count, sum;
n = 28; count = 15; sum = 30;
if (n < 25)
{
count = count + 5;
printf("\n Count = %d" , count);
}
else
{
count = count - 5;
sum = sum + n;
printf("\nCount = %d" , count);
printf("\nSum = %d", sum);
}
What will be the output of this program?
What will be printed when the following code is executed?
x =1;
switch (x)
{
case1:
case 2:
case 3:
printf("/n x is a positive number");
break;
default:
printf("\n value of x is 1");
}
Which of the following is a multiple selection statement?
Which loop is preferred to use when the number of times the loop will execute is not known in advance?
Which of the following is called a counter loop?