Escolar Documentos
Profissional Documentos
Cultura Documentos
Interview process for freshers,written test Pattern 2012,aptitude questions pattern,essay writing topics,c
program asked in interview,career in wipro chennai,salary and training,wipro campus life as a freshers,of
campus experience, interview rounds,placement questions, WASIAN Experience
Search here
Search
Custom Search
Follow by Email
Email address...
Submit
5/28/2012
(23) What will be output if you will compile and execute the following c code?
void main(){
char *str;
scanf("%[^\n]",str);
printf("%s",str);
(d)Compiler error
(e)None of above
Output: (b)
Explanation:
Task of % [^\t] is to take the stream of characters until it doesnt receive new
String tutorial.
(24) What will be output if you will compile and execute the following c code?
void main(){
int a=5,b=10,c=15;
int *arr[]={&a,&b,&c};
printf("%d",*arr[1]);
(a)5
(b)10
(c)15
(d)Compiler error
(e)None of above
Output: (d)
Explanation:
extern variables.
What is auto variable?
Array tutorial.
(25) What will be output if you will compile and execute the following c code?
void main(){
int array[3]={5};
int i;
for(i=0;i<=2;i++)
printf("%d ",array[i]);
(b)5 0 0
(d)Compiler error
(e)None of above
tput: (b)
Explanation:
Storage class of an array which initializes the element of the array at the time
(26) What will be output if you will compile and execute the following c code?
void main(){
int array[2][2][3]={0,1,2,3,4,5,6,7,8,9,10,11};
printf("%d",array[1][0][2]);
}
(a)4
(b)5
(c)6
(d)7
(e)8
Output: 8
Explanation:
i.e. 8.
(27) What will be output if you will compile and execute the following c code?
void main(){
int a[2][4]={3,6,9,12,15,18,21,24};
printf("%d %d %d",*(a[1]+2),*(*(a+1)+2),2[1[a]]);
}
(a)15 18 21
(b)21 21 21
(c)24 24 24
(d)Compiler error
(e)None of above
Output: (b)
Explanation:
In c,
a [1][2]
=*(*(a+1) +2)
=2[a [1]]
=2[1[a]]
Now, a [1] [2] means 1*(4) +2=6th element of an array staring from zero i.e. 21.
Concept of complex array.
(28) What will be output if you will compile and execute the following c code?
void call(int,int,int);
void main(){
int a=10;
call(a,a++,++a);
(a)10 10 12
(b)12 11 11
(c)12 12 12
(d)10 11 12
(e)Compiler error
Output: (b)
Explanation:
Default parameter passing scheme of c is cdecl i.e. argument of function will
void main(){
int x=5,y=10,z=15;
printf("%d %d %d");
(b)5 10 15
(c)15 10 5
(d)Compiler error
(e)Run time error
Output: (c)
Explanation:
print then content of two continuous bytes from the top of the stack and so on.
(30) What will be output if you will compile and execute the following c code?
void main(){
scanf("%d",&i);
(a)17
(b)18
(c)21
(d)22
(e)Compiler error
Output: (e)
Explanation:
(31) What will be output if you will compile and execute the following c code?
void main(){
int a=5;
int b=10;
int a=2;
a++;
b++;
printf("%d %d",a,b);
(a)5 10
(b)6 11
(c)5 11
(d)6 10
(e)Compiler error
Output: (c)
Explanation:
Default storage class of local variable is auto. Scope and visibility of auto
variable is within the block in which it has declared. In c, if there are two
variables of the same name then we can access only local variable. Hence inside
the inner block variable a is local variable which has declared and defined
inside that block. When control comes out of the inner block local variable a
became dead.
void main(){
float f=3.4e39;
printf("%f",f);
(a)3.4e39
(b)3.40000
(c)+INF
(d)Compiler error
Explanation:
If you will assign value beyond the range of float data type to the float
variable it will not show any compiler error. It will store infinity.
void main(){
enum color{
RED,GREEN=-20,BLUE,YELLOW
};
enum color x;
x=YELLOW;
printf("%d",x);
(a)-22
(b)-18
(c)1
(d)Compiler error
(e)None of above
Output: (b)
Explanation:
Hence:
BLUE=GREEN+1=-20+1=-19
YELLOW=BLUE+1=-19+1=-18
(34) What will be output if you will compile and execute the following c code?
void main(){
asm{
mov bx,8;
mov cx,10
add bx,cx;
}
printf("%d",_BX);
(a)18
(b)8
(c)0
(d)Compiler error
(e)None of above
Output: (a)
Explanation:
asm keyword is used to write assembly language program in c. mov command stores
the constants in the register bx, cx etc. add command stores the content of
Advance c tutorial.
(35) What will be output if you will compile and execute the following c code?
void main(){
enum xxx{
a,b,c=32767,d,e
};
printf("%d",b);
(a)0
(b)1
(c)32766
(d)Compiler error
(e)None of above
Output: (d)
Explanation:
Size of enum constant is size of sign int. Since value of c=32767. Hence value
(36) What will be output if you will compile and execute the following c code?
void main(){
if(a==b)
printf("%d %d",a,b);
else
printf("Not equal");
(a)-1 -1
(b)-1 32767
(c)-1 -32768
(d)Not equal
(e)Compiler error
Output: (a)
Explanation:
void main(){
float f=5.5f;
float x;
x=f%2;
printf("%f",x);
(a)1.500000
(b)1.000000
(c)5.500000
(d)Compiler error
(e)None of above
Output: (d)
Explanation:
(38) What will be output if you will compile and execute the following c code?
void main(){
int a=-20;
int b=-3;
printf("%d",a%b);
(a)2
(b)-2
(c)18
(d)-18
(e)Compiler error
Output: (b)
Explanation:
Sign of resultant of modular division depends upon only the sign of first
operand.
void main(){
char c='0';
printf("%d %d",sizeof(c),sizeof('0'));
(a)1 1
(b)2 2
(c)1 2
(d)2 1
(e)None of above
Output: (c)
Explanation:
Size of char data type is one byte while size of character constant is two byte.
void main(){
char *url="c:\tc\bin\rw.c";
printf("%s",url);
(a)c:\tc\bin\rw.c
(b)c:/tc/bin/rw.c
(c)c: c inw.c
(d)c:cinw.c
(e)w.c in
Output: (e)
Explanation:
2. \b is back space character which moves the cursor one space back.
3. \r is carriage return character which moves the cursor beginning of the line.
Complete string tutorial with examples.
(41) What will be output if you will compile and execute the following c code?
void main(){
clrscr();
goto abc;
printf("main");
getch();
void dispaly(){
abc
printf("display");
(a)main
(b)display
(c)maindisplay
(d)displaymain
(e)Compiler error
Output: (e)
Explanation:
Label of goto cannot be in other function because control cannot move from one
unreachable label
(42) What will be output if you will compile and execute the following c code?
void main(){
int i=3;
if(3==i)
printf("%d",i<<2<<1);
else
printf("Not equal");
(a)1
(b)48
(c)24
(d)Not equal
(e)Compiler error
Output: (c)
Explanation:
expression:
i<<2<<1
There are two bitwise operators. From rule of associative leftmost operator will
execute first.
i <<><<>
so i=i*pow(2,2)
=3*
What is associative?
What is precedence?
(43) What will be output if you will compile and execute the following c code?
void main(){
int x=2,y=3;
if(x+y<=5)
printf("True");
else
printf("False");
(a)True
(b)False
Output: (a)
Explanation:
Expression x+y<=5
(44) What will be output if you will compile and execute the following c code?
void main(){
i++;
printf("%d",i);
(a)5
(b)6
(c)0
(d)Compiler error
(e)None of above
Output: (d)
Explanation:
(45) What will be output if you will compile and execute the following c code?
void main(){
*p=2*x;
printf("%d",x);
}
(a)25
(b)50
(c)0
(d)Compiler error
(e)None of above
Output: (b)
Explanation:
const keyword in c doesnt make any variable as constant but it only makes the
variable as read only. With the help of pointer we can modify the const
following line:
void main(){
int i=11;
p++;
printf("%d",*p);
(a)11
(b) 12
(c)Garbage value
(d)Compiler error
(e)None of above
Output: (c)
Explanation:
modify the pointer p. After incrementing the pointer it will point next memory
location and its content will any garbage value.
void main(){
int a=15,b=10,c=5;
if(a>b>c )
printf("Trre");
else
printf("False");
}
(a)True
(b)False
(d)Compiler error
(e)None of above
Output: (b)
Explanation:
Relation operator in c always returns 1 when condition is true and 0 when
a>b>c
following manner:
1>c
Since this condition is false so result will be 0. Thus else part will execute.
What is associative?
What is precedence?
(48) What will be output if you will compile and execute the following c code?
void main(){
float f;
f=3/2;
printf("%f",f);
}
(a)1.5
(b)1.500000
(c)1.000000
(d)Compiler error
(e)None of above
Output: (c)
Explanation:
f=3/2 both 3 and 2 are integer constant hence its result will also be an integer
constant i.e. 1.
void main(){
int a=sizeof(a);
a=modify(a);
printf("%d",a);
int y=3;
_AX=x+y;
return;
(a)2
(b)3
(c)5
(d)Garbage value
(e)None of above
Output: (c)
Explanation:
(50) What will be output if you will compile and execute the following c code?
void main(){
float a=5.5;
if(a==5.5)
else
printf("Not equal");
}
(a)c c++
(b)Not equal
(c)c
c++
(d)Compiler error
(e)None of above
Output: (d)
Explanation:
try.c 1:
try.c 4: if(a==5.5)
try.c 5: printf("c");printf("c++");
try.c 6: else
try.c 8: }
try.c 9:
try.c 10:
If there are more than one statement in if block then it is necessary to write
2 comments
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf("%d %d %d",s.p,s.c,s.m);
(a) 2 -6 5
(b) 2 -6 1
(c) 2 2 1
Answer: (c)
Explanation:
Structure tutorial
More questions
(52) What will be output if you will compile and execute the following c code?
void main(){
char * (*(*array[3]))[3]={&p1,&p2,&p3};
char * (*(*(*ptr)[3]))[3]=&array;
p2+=1;
p3+=2;
printf("%s",(***ptr[0])[2]);
(a) math
(b) phy
(c) che
(d) Compiler error
Answer: (c)
Explanation:
Here
Pictorial representation:
Note: In the above figure upper part of box represent content and lower part
As we know p[i]=*(p+i)
(***ptr[0])[2]=(*(***ptr+0))[2]=(***ptr)[2]
=(***(&array))[2] //ptr=&array
=(*p1)[2]
=(*&s)[2] //p1=&s
=s[2]=che
Pointer tutorial.
(53) What will be output if you will compile and execute the following c code?
#include"conio.h"
int display();
int(*array[3])();
int(*(*ptr)[3])();
void main(){
array[0]=display;
array[1]=getch;
ptr=&array;
printf("%d",(**ptr)());
(*(*ptr+1))();
int display(){
int x=5;
return x++;
}
(a)5
(b)6
(c)0
(d)Compiler error
(e)None of these
Answer: (a)
Explanation:
In this example:
array []: It is array of pointer to such function which parameter is void and
ptr: It is pointer to array which contents are pointer to such function which
=display () //array[0]=display
(*(*ptr+1))() =(*(*&array+1))() //ptr=&array
=getch () //array[1]=getch
Array tutorial.
(54) What will be output if you will compile and execute the following c code?
void main(){
int i;
*ptr='A';
*(ptr+1)=1;
*(ptr+2)='B';
*(ptr+3)=2;
*(ptr+4)='C';
*(ptr+5)=4;
}
Answer:
It output will be A, B and C in blue, green and red color respectively. As shown
in following figure:
Advance c tutorial?
Working with text video memory.
(55) What will be output if you will compile and execute the following c code?
#include "dos.h"
void main(){
int j;
i.h.ah=0;
i.h.al=0x13;
int86(0x10,&i,&o);
for(j=1;j<=100;j++){
*(ptr+j)=4;
Answer:
One red color line in the graphics console as shown in the following figure
What is union REGS?
Advance c tutorial.
void main(){
*p=200;
printf("%d",*q);
(a)0
(b)Garbage value
(c)null
(d) 200
(e)Compiler error
Answer: (d)
Explanation:
=0XC0560 + 0X3331
=0XC3891
=0XC2550 + 0X1341
=0XC3891
Since both huge pointers p and q are pointing same physical address so content
(57) Write c program which display mouse pointer and position of pointer.(In x
coordinate, y coordinate)?
Answer:
#includedos.h
#includestdio.h
void main()
{
union REGS i,o;
int x,y,k;
i.x.ax=1;
int86(0x33,&i,&o);
while(!kbhit()) //its value will false when we hit key in the key board
x=o.x.cx;
y=o.x.dx;
clrscr();
printf("(%d , %d)",x,y);
delay(250);
int86(0x33,&i,&o);
getch();
What is int86?
Advance c tutorial.
Answer:
Step 1: Write following code.
#include stdio.h
#include dos.h
struct find_t q ;
int a;
if(count==1)
argv[1]="*.*";
a = _dos_findfirst(argv[1],1,&q);
if(a==0)
{
while (!a)
a = _dos_findnext(&q);
else
}
Step 2: Save the as list.c (You can give any name)
properties.
Step 8: Open command prompt and write list and press enter.
(59) What will be output if you will compile and execute the following c code?
void main(){
int i=10;
if(x==i)
printf("Equal");
else if(x>i)
printf("Greater than");
else
printf("Less than");
(a) Equal
Answer: (d)
Explanation:
static variables are load time entity while auto variables are run time entity.
We can not initialize any load time variable by the run time variable.
(60) What will be output if you will compile and execute the following c code?
void main(){
int i;
float a=5.2;
char *ptr;
ptr=(char *)&a;
for(i=0;i<=3;i++)
printf("%d ",*ptr++);
}
(a)0 0 0 0
(c)102 56 -80 32
(e)Compiler error
Answer: (d)
Explanation:
In c float data type is four byte data type while char pointer ptr can point one
ptr pointer will point first fourth byte then third byte then second byte then
first byte.
Binary value=01100110
Decimal value= 64+32+4+2=102
Binary value=01100110
Decimal value=64+32+4+2=102
Binary value=10100110
Decimal value=-128+32+4+2=-90
Binary value=01000000
Decimal value=64
Note: Character pointer treats MSB bit of each byte i.e. left most bit of above
(61) What will be output if you will compile and execute the following c code?
void main(){
int i;
double a=5.2;
char *ptr;
ptr=(char *)&a;
for(i=0;i<=7;i++)
printf("%d ",*ptr++);
}
(b) 51 52 52 52 52 52 20 64
Explanation:
In c double data type is eight byte data type while char pointer ptr can point
ptr pointer will point first eighth byte then seventh byte then sixth byte then
fifth byte then fourth byte then third byte then second byte then first byte as
Binary value=11001101
Binary value=11001100
Binary value=11001100
Binary value=11001100
Binary value=11001100
Binary value=11001100
Binary value=000010100
Decimal value=16+4=20
Binary value=01000000
Decimal value=64
Note: Character pointer treats MSB bit of each byte i.e. left most bit of above
(62) What will be output if you will compile and execute the following c code?
void main(){
(b) c
(c) bank
(d) cquestionbank
Answer: (d)
Explanation:
(63) What will be output if you will compile and execute the following c code?
void main(){
printf("%s",__DATE__);
(c) null
Answer: (a)
Explanation:
void main(){
char *str="c-pointer";
printf("%*.*s",10,7,str);
(a) c-pointer
(b) c-pointer
(c) c-point
(e) c-point
Answer: (e)
Explanation:
First * indicates the width i.e. how many spaces will take to print the string
and second * indicates how many characters will print of any string.
Following figure illustrates output of above code:
(65) What will be output if you will compile and execute the following c code?
void start();
void end();
int static i;
void main(){
void start(){
clrscr();
void end(){
getch();
}
(a)
main function: 2
start function: 1
end function:3
(b)
start function: 1
main function: 2
end function:3
(c)
main function: 2
end function:3
start function: 1
Explanation:
Every c program start with main function and terminate with null statement. But
#pragma startup can call function just before main function and #pragma exit
Preprocessor tutorial.
(66) What will be output if you will compile and execute the following c code?
void main(){
int a=-12;
a=a>>3;
printf("%d",a);
(a) -4
(b) -3
(c) -2
(d) -96
Explanation:
Rule 1: If number is positive the fill vacant spaces in the left side by 0.
Rule 2: If number is negative the fill vacant spaces in the left side by 1.
In this case number is negative. So right shift all the binary digits by three
complement.
Operator tutorial.
(67) What will be output if you will compile and execute the following c code?
#include "string.h"
void main(){
clrscr();
printf("%d %d",sizeof("string"),strlen("string"));
getch();
}
(a) 6 6
(b) 7 7
(c) 6 7
(d) 7 6
Explanation:
Sizeof operator returns the size of string including null character while strlen
String tutorial.
(68) What will be output if you will compile and execute the following c code?
void main(){
static main;
int x;
x=call(main);
clrscr();
printf("%d ",x);
getch();
address++;
return address;
(a) 0
(b) 1
Explanation:
As we know main is not keyword of c but is special type of function. Word main
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf("%d ",a+b);
getch();
(a) 3
(b) 21
(c) 17
(d) 7
Answer: (d)
Explanation:
b= (2, 4, 6);
In the above two statements comma is working as operator. Comma enjoys least
int dynamic(int,...);
void main(){
int x,y;
x=dynamic(2,4,6,8,10,12,14);
y=dynamic(3,6,9,12);
clrscr();
printf("%d %d ",x,y);
getch();
ptr=...;
(int *)ptr+=2;
s=*(int *)ptr;
return s;
(a) 8 12
(b) 14 12
(c) 2 3
Explanation:
int extern x;
void main()
printf("%d",x);
x=2;
getch();
int x=23;
(a) 0
(b) 2
(c) 23
Answer: (c)
Explanation:
extern variables can search the declaration of variable any where in the
program.
(72) What will be output if you will compile and execute the following c code?
void main(){
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf("%d",i);
else
printf("equal");
(a) 5
(b) 3
(c) 1
(d) equal
Explanation:
Comma operator.
Operator tutorial.
(73) What will be output if you will compile and execute the following c code?
void main(){
int a=25;
clrscr();
printf("%o %x",a,a);
getch();
(a) 25 25
(c) 12 42
(d) 31 19
Explanation:
Note: In c octal number starts with 0 and hexadecimal number starts with 0x.
power of c"
void main(){
clrscr();
printf("%s",message);
getch();
}
(a) union is power of c
(c) union is
Power of c
Answer: (b)
Explanation:
If you want to write macro constant in new line the end with the character \.
Preprocessor tutorial.
(75) What will be output if you will compile and execute the following c code?
#define call(x) #x
void main(){
printf("%s",call(c/c++));
}
(a)c
(b)c++
(c)#c/c++
(d)c/c++
(e)Compiler error
Answer: (d)
Explanation:
test.c 1:
test.c 3: printf("%s","c/c++");
test.c 4: }
test.c 5:
(75) What will be output if you will compile and execute the following c code?
void main(){
if(printf("cquestionbank"))
else
}
(a) I know c
Answer: (c)
Explanation:
return 13. In if condition any non- zero number means true so else part will not
execute.
1) -7 2) ++i
2) stdin,stdout, stderr
3) keyboard,screen,screen
1) extern 2) static
3) stat 4) auto
1) fflush() 2) ferror()
3) exit() 4) clearerr()
7) Heap
3) is a finite area
2) must be structure
Char name[30]?
{2.1,2.2,2.3}
};
1) 2.2 2) 1.2
3) 2.1 4) 2.3
Assignments:
Char c=c,d=d;
(3*i-2*j)%(2*d-3)
1)14 2)18
3) 1 4) 0
2) f accepts two arguments and returns a double precision quantity, and the second is an integer
3) curly braces 4) #
17) The int type of constraints are whole numbers in the range
18) If the variables i,j and k are assigned the values 5,3 and 2 respectively, then the expression i=j+(k++
=6)+7;
Compare
3) program examples
4) files that contain functions which carry out various commonly Used operations and calculations
38) which of the following expressions will return a 1 if both bits have A value of 1; otherwise will return
a value of 0?
1) AND 2)OR 3)XOR 4)1stderr complement
39) If an error occurs while opening a file the file pointer is assigned a value
1) \b 2) \a 3) \r 4) \s
43) If p and q are assigned the values 2 and 3 respectively then the statement p=q++
3) parentesis 4) / and/
1) x 2) xo 3) 0x 4)h
3) parenthesis 4) / and /
3) a member of a union
52) A single character input from the keyboard can be obtained by using the function
53) An expression
1) is a collection of data objects and operators that can be evaluated to a single value
3) Value of I assigned to c
4) I to be incremented by 1
56) The conversion character I for data output means that the
4) an octal integer
C QUESTIONS ON ARRAYS
main()
Int a[5];
a[-2]=10;
a[2]=1;
printf(%d,-2[a]);
Ans c
main()
Char a[3][3]={{a,b,c},pqr,xy};
Printf(%s\n,&a[0][0]);
Ans c
main()
char a[3][3]={abc,pqr,xyz};
printf(%c,a[2][2]);
a) q b) r c) z d) compilation error
Ans c
4) main()
Char a[100]={abcdef};
a++;
printf(%s,&a[1]);
Ans c
5) main()
Char *p=algc;
Printf(%c,++*(p++));
Printf(%c,*++p);
ans b
6) main()
Int n[25];
n[0]=100;
n[24]=200;
printf(%d%d,*n,*(n+24)+*(n+0));
Ans b
7)main()
Int a[3]={1};
Printf(%d,a[1]);
Ans b
8) main()
Printf(%d%d%d,n[2][1],n[1][1],n[3][1]);
ans a)
9) main()
Char a=ab;
Printf(%c,a);
a) a b) b c) ab d) error
ans a)
10) main()
Char *p;
p=%d\n;
p[1]=c;
printf(p,65);
a) A b) c c) 65 d) error
ans a
11) main()
int a=1;
switch(a==5)
Case 1: pf(hi);
Break;
Case 0:pf(hello);break;
Default : pf(wipro\n);
a) Hi b)hello c) hi d)wipro
Ans: b
12) main()
Char a[]={\012345\};
Printf(%s %d %d\n,a,sizeof(a),sizeof(*a));
13) main()
Char a[]=hell0009;
Printf(%s\n,a);
Ans:: hell0009
c) null
ans c
c) If the list does not exist, assign start to the new node.
d) If the list exists insert the new node at the end of the list.
a) 1234
b) 1324
c) 4321
d) 3124
Ans a)
2) Repeat steps 2 & 3 until the the temporary pointer points to null.
b) 1432
c) 1342
d) 2314
Ans c
2) if the node to be deleted is the start then start is made to point to the next node.
3) searching for the node to be deleted by comparing the data with the data entered by the user.
4) if the node to be deleted is in the middle of the list the previous node is made to point to the next
node.
e) 1234
f) 3241
g) 1324
h) 2431
Ans f
6) if a node (q) is to be inserted at the beginning the operations which are performed is
1) q->next =start->next
start =q;
2) start=q;
q->next=start;
3) q->next=start;
q=start;
4) q->next =start;
start =q;
ans 4
7) when start and last points to same node,how many elements are present
Ans 2
Ans : a
main()
int a[5]={2,3};
printf("\n %d %d %d",a[2],a[3],a[4]);
main()
int i=-3,j=2,k=0,m;
m=++i&&++j||++k;
printf("\n %d %d %d %d",i,j,k,m);
ans::a
3) main()
Int n[25];
n[0]=100;
n[24]=200;
printf(%d%d,*n,*(n+24)+*(n+0));
4)
main()
printf("%s\n",&str[5]);
}
ans::in wipro
5) main()
Char *p=algc;
Printf(%c,++*p++);
Printf(%c,*++p);
a)al b) mg c) lg d) none
ans::none.....bg
6)main()
void fun(int);
int n=3;
fun(n);
void fun(int n)
if(n>0)
fun(--n);
printf("%d",n);
fun(--n);
ans::0120
main()
struct emp
char name[20];
int age;
float sal;
};
printf("\n %d %f",e.age,e.sal);
(a) 0 0.000000 (b) Garbage values (c) Error (d) none of the above
ans::a
8).main( )
int a[ ] = {10,20,30,40,50},j,*p;
printf(%d ,*a);
a++;
p = a;
printf(%d ,*p);
p++;
9.main()
int c[ ]={2,3,4,6,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++)
printf(" %d ",*p);
++q;
for(j=0;j<5;j++)
{
printf(" %d ",*p);
++p;
ans::222223465
10.
#define ABC 20
#define XYZ 10
void main()
int a;
a = XXX * 10;
printf("%d\n", a);
ans::-80
void main()
12.void main()
int cnt = 5, a;
do {
a /= cnt;
ans::Error..divide error
int a, b, c, abc = 0;
a = b = c = 40;
if (c) {
int abc;
abc = a*b+c;
}
printf ("c = %d, abc = %d\n", c, abc);
ans::40 0
14.main()
int k = 5;
printf("%d\n", k);
ans::7
15.main()
int i;
char *t;
t=names[3];
names[3]=names[4];
names[4]=t;
for (i=0;i<=4;i++)
printf("%s",names[i]);
int x=20;y=35;
x=x++ + y++;
y=++y + ++x;
printf("x=%d y=%d\n",x,y);
ans::57 94
struct student
int a;
char name[10];
int *p;
}s1,*s2;
printf("%d%d",sizeof(s1),sizeof(*s2));
a) 18,18
b)18,4
c) 4,18
d) 4,4
18.int fun(int x)
int y=55;
return((x-y)?y:x);
main()
int a=20;
fun(a);
printf("%d",y);
ans::20
19.int compute(int n)
if(n>0)
n=compute(n-3)+compute(n-1);
return(n);
return(1);
void main()
printf("%d",compute(5));
}
20.int main()
char *ptr="abcdefgh";
char *sptr;
sptr=ptr+5;
printf("%s",sptr);
ans::fgh
1. printf("%d %d %d",sizeof(25.75),sizeof(123),sizeof(p))
a. 2 2 2 b. 4 2 2 c. 8 4 1 d. 8 2 2
ans::d
2. int i=5;
fun( )
printf("%d\n", i * 3);
main( )
int i= 2;
int i = 3;
fun();
a. 3, 15
b. 3, 6
c. 3
d. 0
Ans::a
main( )
int i, j;
i = 5;
j = xsq(i-2);
printf(%d\n, j);
}
a. 7
b. 9
c. 13
d. 29
Ans::-7
4. main( )
int a=35;
a. 1 50 1
b. 1 50 0
c. 0 50 0
d. 0 50 1
ans::c
Reactions:
Email This
BlogThis!
Share to Twitter
Share to Facebook
Share to Pinterest
No comments:
Post a Comment
Blog Archive
2011 (1)
2012 (35)
Apr (4)
May (22)
Aug (3)
Sep (2)
Oct (1)
Nov (1)
Dec (2)
2013 (3)
2015 (1)
Click below
Popular Posts
Wipro Salary Category based on Training Results | Salary Structure for fresher India
WASE Salary Package 2012 | Review | Salary hike | Stipend | Revised Scholarship
Total Pageviews
564,257
Wipro Candidate Experience since 2011. Awesome Inc. theme. Powered by Blogger.