1) void main

()
{
clrscr();
printf(“..,%d”,printf(“..,%d”,printf(“C
Aptitude”)));
getch();
}

int m;
clrscr();
m=2*f(3,g(4,5));
printf("\n m is %d",m);
getch();
}
a.46 b.50 c.26 d.69

2) void main()
{
int i;
clrscr();
for(i=0;i++;i<=5)
printf("%d",i);
printf("%d",i-1);
getch();
}
3) void main()
{
int i;
clrscr();
do{
i=1;
scanf("%d",&i);//input as 12
i++;
printf("%d",i);
}while(i<=10);
getch();
}
4) void main()
{
int x=5,y=5,sum=0;
clrscr();
for(;x--;)
sum+=- -y/x;
printf("%d",sum);
getch();
}

5)
#define f(a,b) a+b
#define g(a,b) a*b
void main()
{

6) void main()
{
int ch,ch1;
if(stricmp("Hai","Hai")) ch=5;
else ch=ch1;
switch(ch)
{
default:printf("\nIn default");
case 1: printf("\nIn choice 1");
break;
case 2: printf("In choice 2");
break;
case 3*2-1: printf("\nIn choice 3");
}
}
7) void main()
{
int a=1,b=1;
if(a==0)
if(b==1)
printf("Hai");
else
printf("bye");
getch();
}
a.Hai b.bye c.No output d.None of these
8) void main()
{
int i=300*300/300;
clrscr();
printf("%d",i);
getch();
}
a.300 b.81 c.90000 d.Error

9) void main()
{
int i=10/0;
clrscr();
printf("%d",i);
getch();
}
10) #define A(a,b) a>b?1:2
void main()
{
clrscr();
printf("%d %d",A(A(1,2),1),A(A(2,1),1));
getch();
}
10) void main()
{
static int i;
clrscr();
if(i++)
{
printf("%d",i);
main();
}
printf("%d",i-1);
getch();
}
11) void main()
{
int i,j=5;
clrscr();
printf("%d",scanf("%d %d",&i,&j)); //input
as 10,11
getch();
}
12) void main()
{
extern int i;
printf(“%d”,sizeof(i));
}
13) void main()
{
int a[]={1,2,3,4}; int *p;

p=&a;
printf(“%u”,&p);
printf(“%u”,&++p);
}
14) void main()
{
int *p,a=10;
p=&a;
printf(“%d”,*p**(&a));
getch();
}
15) void main()
{
char *p; int a[]={1,2,3};
p=&a;
printf(“%u”,&p);
printf(“%d”,*p++);
}
CompanyBased Logical Quesiton:
1) Write a program to add 2 no. without
using Arithmetic Operators;
2) To Print 1 to 1000 without using
Conditonal and branching(loop) statement;
3) To Check whether the no. is Odd/Even
without using % and / operator;
4) To print your name without using
statement terminator in the whole program.
5) Write the Peculiar feature of sprintf();

Sign up to vote on this title
UsefulNot useful