NEW
Font size
WorksheetsBridge course with C
Total questions: 20
Worksheet time: 15mins
Which of the following is true for variable names in C?
. Variable names cannot start with a digit
Variable can be of any length
They can contain alphanumeric characters as well as special
characters
Reserved Word can be used as variable name
Which of the following cannot be a variable name in C?
true
friend
export
volatile
Variable name resolving (number of significant characters for uniqueness of variable) depends on?
Compiler and linker implementations
Assemblers and loaders implementations
C Language
None
Which of the following is not a derived data type in c?
Function
Pointer
Enumeration
Array
Integral data type is ____?
Void
Char
Float
Double
Which among the following is the odd one out?
printf
fprintf
putchar
scanf
For a typical program, the input is taken using _________
scanf
Files
Command-line
All of the mentioned
Which of the following is not a compound assignment operator?
/=
+=
%=
==
p++ executes faster than p + 1 since
P uses registers
Single machine instruction required for p++
Option a and b
None
Syntax error in declaration of a
No errors, program will show the output 5
Redeclaration of a in same scope throws error
a is out of scope when printf is called
What is the output of the following program?
#include <stdio.h>
int main()
{
static int a = 3;
printf(“%d”, a --);
return 0;
}
0
1
2
3
What is the output of this C code?
int main()
{
int i = 5;
int l = i / -4;
int k = i % -4;
printf("%d %d\n", l, k);
return 0;
}
Compile time error
-1 1
1 -1
Run time error
What will be the output of the program ?
#include<stdio.h>
int main()
{
float a=3.15529;
printf("%2.1f\n", a);
return 0;
}
3.00
3.15
3.2
3
What will be the output of the program if value 25 given to scanf()?
#include<stdio.h>
int main()
{
int i;
printf("%d\n", scanf("%d", &i));
return 0;
}
25
2
1
5
Which statement will you add in the following program to work it correctly?
#include<stdio.h>
int main()
{
printf("%f\n", log(36.0));
return 0;
}
#include<conio.h>
#include<math.h>
#include<stdlib.h>
#include<dos.h>
What will be the output of the program?
#include<stdio.h>
int main()
{
float a=0.7;
if(a < 0.7)
printf("C\n");
else
printf("C++\n");
return 0;
}
C
C++
Compiler error
none of the above
18. What will be the output of the program?
#include<stdio.h>
#include<math.h>
int main()
{
printf("%f\n", sqrt(36.0));
return 0;
}
6.0
6
6.000000
Error: Prototype sqrt() not found.
Point out the error in the program?
#include<stdio.h>
int main()
{
char ch;
int i;
scanf("%c", &i);
scanf("%d", &ch);
printf("%c %d", ch, i);
return 0;
}
Error: suspicious char to in conversion in scanf()
Error: we may not get input for second scanf() statement
No error
None of above
What will be the output of the program ?
#include<stdio.h>
int main()
{
int a=250;
printf("%1d\n", a);
return 0;
}
1250
2
50
250
A programA program is made up of individual syntactic elements, called is made up of individual syntactic elements, called
Classes
Functions
Tokens
None of them
