Binsys Technologies PVT - LTD
Binsys Technologies PVT - LTD
Ltd
H-33/48, DLF-Phase-1, Gurgaon (HR)
C Language (Theory)
Instructions
Name:____________________________________________________________
______
Father
Name:____________________________________________________________
_
Student
Signature__________________________________________________________
Objective
Questions
int x=100;
if(!!x)
printf(“x=%d”,!x);
else printf(“x=%d”,x);
a. 0
b. 2
c. 1.5
d. 100
2. void main(){
if(a&&b>0.9)
printf(“it is ur style”);
else
printf(“it is my style”);
a. it is ur style
b. it is our style
c. it is my style
d. no output
3. void main( ){
printf(“x=%d”,x);
else
printf(“y=%d”,y);
a. 10
b. 20
c. 1
d. 0
4. void main(){
char ch=291;
printf(“%d%d%c”,32770,ch,ch);
a. 291
b. -32766 35#
c. 32770chch
d. 32770
int a,b;
a = -3- -3;
b = -3 - - (-3 );
printf(“a=%d b= %d”,a,b);
}
a. a=0 b=-6
b. a=-3 b=+3
c. a=-6 b=+6
d. a=6 b=0
6. void main(){
int x;
x= -3 + 4 – 7 * 8 / 5 % 10;
printf(“x = %d”,x);
a. 23
b. 6
c. 7
d. 0
7. void main(){
a. 100
b. 300
c. 200
d. No Output
8. void main( ){
printf(“x= %d”,x);
a. 10
b. 50
c. 1
d. 0
9. void main( ){
if(x=y)
else
c. No output
for(;j;printf(“%d%d\t”,i,j))
j=i++ <= 5;
a. 21 31 41 51 61 70
b. 21 30 41 50 61 70
c. 20 30 40 50 60 70
d. 21 31 41 51 61 71
11.
void main(){
char far *p=(char far *)0x55550005;
char far *q=(char far *)0x53332225;
clrscr();
*p=25;
(*p)++;
printf("%d",*q);
getch();
}
12.
void main()
{
char i=13;
clrscr();
while(i)
{
i++;
}
printf("%d",i);
getch();
}
13.
void main()
{
int a=5,b=5;
clrscr();
if(b^a)
printf("EQUAL”);
getch();
}
14.
void main()
{
char a='\x82';
clrscr();
printf("%d",a);
getch();
}
15.
void main()
{
enum {a,b=32766,c,d,e=0};
clrscr();
printf("%d",a);
getch();
}
16.
17.
void main()
{
int i;
struct arr1
{
int a[8];
};
struct arr1 p={1,2,3,4,5,6,7,8},q;
q=p; //copy in one line
clrscr();
for(i=0;i<8;i++)
{
printf("%d",q.a[i]);
}
getch();
}
18.
void main()
{
char arr[8]={'S','A','V','R','I','Y','A'};
char *p;
p=(char *)(arr+2)[2];
clrscr();
printf("%c",p);
getch();
}
19.
void main()
{
float a=5e4;
clrscr();
printf("%f",a);
getch();
}
20.
void main()
{
float a=5e40;
clrscr();
printf("%f",a);
getch();
}
Concept based
Questions 10x1=
10
21. What is the output of printf ("%d")?
22. What is the advantage of function pointer?
23. Can Structures be used with an Array?
24. What information does the header files contain?
25. Write a program to find out number of on bits in a number?
26. What is function pointer and where we will use it?
27. What is the difference between NULL & NUL keywords in C?
28. How many types of data structures are there?
29. Write code for initializing one dimensional and two dimensional arrays in a C
Program?
30. How does 'free' know how many bytes to free?
Fill in the
blanks
10x1= 10
Matching Type
Questions
10x1= 10
Subjective Questions
5x10= 50
51.
ax +bx+c=0-------------------------------- (1)
2
Write C Program to calculate root of equation (1) based on input parameter’s a, b, c given
by the user, Also verify your solution’s with input parameter a=3,b=4,c=5
52.
54. Write a program which will find out leap years of a calendar year?
55.
A Monkey would like to climb on a pole which has height H meter, in First minute they
climb x meter on the pole , in next minute they fall y meter on the pole, then find the time
taken by the monkey to climb on the pole? Write a C Program to calculate time taken by
the monkey in reaching on top of the pole? Take all parameters from users? Verify the
results with H=50 m, x=5m, y=2m
56. Write a program to convert Temperature (in Celsius) to Fahrenheit and vice versa?
All input taken from users? and verify the results with temperature T=40 C .
0
57. What is Bubble sort? How do you implement it with C Programming Language?
Write a Code to Sort N Numbers given in an Array A? Verify the results with
A=[3,4,1,2,9,4,20,33,42,22,33,44,10,4,2,3,56]
58. Which kind of output produce given below this program, suppose we enter N=56 ,
then which kind of input we get?
#include <stdio.h>
#include <conio.h>
int main()
int num,divisor = 2;
printf("Enter number:");
scanf("%d",&num );
printf("---------------------------------------------\n");
while( !IsPrime(num))
while(1)
if( num%divisor == 0 )
printf("%d\n",divisor );
num/=divisor;
break;
printf("%d",num);
getch();
return 0;
int i;
if( num%i == 0 )
return 0;
return 1;
int FindNextPrime( int num ) // Returns next prime number from passed arg.
do
if( num == 2 )
num++;
else
num+=2;
} while( !IsPrime(num));
return num;
}
59.
This Program Calculate GCD of two Numbers (The greatest common divisor of
integers x and y is the largest integer that evenly divides both x and y) Complete
blank part in this code so that it works nicely?
using System;
using System.Collections.Generic;
using System.Text;
namespace exe_2_4
class Program
int x, y;
x = int.Parse(Console.ReadLine());
y = int.Parse(Console.ReadLine());
}
public static void gcd(int x, int y)
if (y == 0)
else
60. Write a Program for printing reverse order numbers? For Example suppose
N=5662982, then your program should print 2892665?
_________________________________________________THE
END________________________________________
GOOD LUCK
Name:____________________________________________________________
______
Father
Name:____________________________________________________________
_
Student
Signature_________________________________________________________