Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
EMPLOYEE NO : DURATION:
Question-1:
#include<stdio.h>
Void main()
{
Int a, b, c , k
a=5;
b=2;
c=3;
k = ((a * b) + c) (2.5 * a + b);
printf(“%d”, k);
}
Output:
a) 227
b) 227.5
c) No output
d) Error
Question-2:
#include<stdio.h>
Void main()
{
Int a, b;
a=b=3=4;
printf(“%d”, a+b);
}
Output:
a) 7
b) 3
c) 4
d) Error
Question-3:
#include<stdio.h>
Void main()
{
float a=5, b=2;
int c;
c = a % b;
printf(“%d”, c);
}
Output:
a) 2.5
b) 1
c) 2
d) error
Question-4:
#include<stdio.h>
void main()
{
int a;
a = 30 * 1000 + 2768;
printf(“%d”, a);
}
Output:
a) 32768
b) -32768
c) 113040
d) 0
Question-5:
#include<stdio.h>
void main()
{
int k = 35;
printf(“%d%d%d”, k ==35, k = 50, k > 40);
}
Output:
a) 0 50 0
b) 1 50 1
c) 1 50 0
d) 0 50 1
Question-6:
#include<stdio.h>
void main()
{
int a = 5, b, c;
b = a = 15;
c = a < 15;
printf(“\na = %d b = %d c = %d”, a, b, c);
}
Output:
a) a =15 b = 15 c = 0
b) a = 5 b = 15 c = 0
c) a = 15 b = 15 c = 1
d) a = 5 b = 15 c = 1
Question-7:
#include<stdio.h>
void main()
{
float a = 12.25, b = 12.52
if(a = b)
printf(“a and b are equal);
}
Question-8:
#include<stdio.h>
void main()
{
int x = 2
if(x ==2 & x != 0);
{
printf(“hi”);
}
else
printf(“bye”);
}
Output:
a) hi
b) bye
c) error
d) hi bye
Question-9:
#include<stdio.h>
void main()
{
int x= 4, y, z;
y = --x;
z = x--;
printf(“%d%d%d”, x, y, z);
}
Output:
a) 4 3 4
b) 2 3 3
c) 4 3 3
d) 2 3 4
Question-10:
#include<stdio.h>
void main()
{
int i;
while (i = 10)
{
printf(“%d”, i);
i = i + 1;
}
}
Output:
a) 1 to 10 will be printed
b) 0 to 9 will be printed
c) error
d) infinite loop
Question-11:
If a file is opened for reading it is necessary that the file must exist (TRUE/FALSE)
Question-12:
If a file opened for writing already exists its content would be overwritten
(TRUE/FALSE)
Question-13:
For opening a file in append mode it is necessary that the file should exist
(TRUE/FALSE) // not sure :-)
Question-14:
We can send arguments at command line even if we define main() function without
parameters (TRUE/FALSE) // not sure :-)
Question-15:
To use standard file pointer we don’t need to open the file using fopen()
(TRUE/FALSE)
Question-16:
Using stdaux we can send output to the printer if printer is attached to the serial port
(TRUE/FALSE)
Question-17:
#include<stdio.h>
void main()
{
int i =3, j =4, k ,l;
k = addmult(i, j);
l = addmult(i,j);
printf(“%d%d”, k, l)
}
addmult( int ii, int jj)
{
int kk, ll;
kk = ii + jj;
ll = ii + jj;
return( kk, ll);
}
Output:
a) 7 7
b) 7 4
c) 3 7
d) error
Question-18:
#include<stdio.h>
void main()
{
float a = 15.5;
char ch = ‘C’;
printit(a, ch);
@NIIT ALL THE BEST!!! 6 of 10
Problem Solving and C
printit(a, ch)
{
printf(“%f%c”, a, ch);
}
Output:
a) 15.5 C
b) 15 C
c) infinite loop
d) error
Question-19:
Output:
a) Compilation Error
b) b will contain some garbage value and c will be equal to 200
c) b will be equal to 300 and c will return some garbage value.
d) b and c will return garbage values
Question-20:
The difference between the concept of structures and unions in C language is in terms of
Output:
a) speed
b) storage
c) Both 1 and 2
d) None of the above
Question-21:
Array of structure is
Output:
a) An array in which each element is a structure
b) A Structure in which each element is an array
c) Both 1 and 2
d) None of the above
Question-22:
Question-23:
Question-24:
Output:
a) prints array element
b) takes array elements as input from user
c) gives error
d) none of the above
Question-25: