0% found this document useful (0 votes)
17 views66 pages

C Programming ACE

Uploaded by

letsabhi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
17 views66 pages

C Programming ACE

Uploaded by

letsabhi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 66

7

Programming Languages
04 . main()
Level-1 Questions
{
printf("\nab");
Basics: printf("\bsi");
printf("\rha");
0 1. main() }
(a) hai (b) ab
(c) ha (d) si
extern int i;

i == 20; 05. #include <stdio.h>

printf("¾ d", i); #define a 10


m ain()
}
{
(a) Compiler Error (b) 20
#define a 50
(c) Linker E rror (d) Runtim e Error
printf("¾d", a);
}
02. main() (a) 50 (b) Complier Error
(c) l 0 (d) Runtime Error
int c== - - 2;
06 . #define c lrscr() 100
printf(" c==¾d" ,c );
main()
} {
(a) - 2 (b) 2 clrscr( );
(c) Compiler Error ( d) None of these printf("¾d \n",clrscr( ));
}

03 . main( ) (a) 100 (b) Complier Error


(c) 10 ( d) Runtime Error
{
inti== 10; 07 . main()
i == !i> 14 ; {
int i;
printf(" i == ¾d" ,i);
printf("¾ d", scanf("¾d",&i)) ;
}
// value 10 is given as input here

(a) 0 (b) I
(a) 10 (b) 0
(c) 14 (d) I 0
(c) I (d) None of these

India '• Beet Online Coachln& Platfo rm for OATlt, ltBlt, PSUe, 88C-Jlt, SBC, Banke, Groupe a, PBC bame

l En.Joy a emooth onllne learnln1 experience In varloue lancu•1ee at your convenience


I {•}~~w~ 3 lillHlllll1lllr!lll1~
I I
08. main() 12. #define FALSE -1
{ #define TRUE I
int i = 0; #define NULL 0
for( ; i++; printf("¾d" ,i)) main()
printf("¾d" ,i); {
} if(NULL)
puts("NULL ");
(a) 0 (b) l else if(FALSE)
(c) 2 (d) 3 puts("TRUE");
else
09. main() puts("FALSE");
{ }
printf("¾d", out); (a) NULL (b) TRUE
} (c) FALSE ( d) None of these
int out = I 00;
13 . main()
(a) I 00 (b) Compiler Error {
(c) Runtime Error ( d) None of these int k=l;
printf("¾d==I is ¾s", k, k == I?
l 0. main() "TRUE": "FALSE");

{ }
ex tern out; (a) 1 = = l is TRUE
printf("¾d", out); (b) l = =l is FALSE

} (c) l= = l

int out = 100; ( d) Compiler Error

(a) l 00 (b) Compiler Error

(c) Runtime Error (d) None of these 14. #include<stdio.h>


main()
{
11. main()
register i=5 ;
{
char j[ ]= "hello";
main();
printf("¾s ¾ d" , j , i);
}
(b) Compiler Error }
(a) Linker Error
( d) No output (a) hello 5 (b) 5 hello
(c) Runtime Error
(c) 5 (d) he llo

Recular Live Doubt clearln1 Se-■lon• I Free Online Teat Serles I ASK an expert
ace Affordable Fee I Available lM I 3M I 6M 112M I 18M and 24 Month• Sub■crlptlon Packages
online
;u@YhhhhihMMIIIYihi~
15. inti ; 19. main()
main()
{
regi ster int a=2;
int t ;
printf("Address of a = ¾d", &a);
for(t=4 ;scanf("%d" ,&i)-t;printf(" ¾ d\n" ,i))
printf("¾ d--" ,t--); printf("Value of a = ¾d", a);
} }
If the inputs are 0, 1,2,3 then what is the output? (a) 2
(a) 4--0, 3--1 , 2--2 (b) 0--4, 2--2, 3--2 (b) Compiler Error
(c) 2--2, 3--3, 0--4 (d) 4--0, 2--0, 2--3 ( c) Runtime Error
(d) None of the above
16. main()
{
20. main()
int a= 0;int b = 20 ;char x = 1;
chary =10; {

if(a,b,x,y) extern i;
printf("hello"); printf(" ¾d\n", i);
} {
(a) hello (b) 0
inti= 20;
(c) 20 (d) 10
printf(" ¾d\n", i);

17. void main( ) }


{ }
char a[ ]=" 12345\0"; (a) Garbage value (b) Compiler Error
int i=strlen(a); (c) Runtime Error (d) Linker Error
printf("here in 3 ¾d\n", ++i);
} 2 1. main( )
(a) here in 3 6 (b) here in 3 5
{
(c) here in 3 4 ( d) None of these
cha r a[4 ]= "HELL";

18. main() printf("¾s", a);


{ }
c har p[ ] = "¾ d\n"; (a) L
p[l) = ' c' ; (b) HELL
printf(p ,65); ( c) Compiler Error
}
(d) HELL co ntinues with garbage values
(a) C (b) B
(c) A (d) D
India '• Be .t Online Coaoh ln& Platform for GATE, ESE, P8Ua, SSC-Jlt, SSC, Bank■ , Oroup■ & PSC ltaam•
I\Jlf ace
~ online Enjoy a ■mooth onllne learning ex·perle n c e ln varlou■ lancuaae■ at :,our convenience
jiiiiP

5 ;p@@hhhhldWl®m~

Operators: 26. main()


{

22. main() exte rn inti ;

{ i = 20;
printf("¾d", sizeof( i));
int i = -1 , j = - 1, k = 0 / = 2 m ·
' ' ' }
m = i++&& j++ && k++11 /++·
II '
(a) 20 (b) Linker E rror
printf(" ¾d ¾d ¾d ¾d ¾d" i J. k / m)·
' ' ' ' ' , ( d) Runtime E rror
(c) Compiler Error
}
(a) 0 0 l 3 l (b) 0 1 0 3 l
27. main()
(c) 0 0 1 1 1 (d) 0 0 l l 3
{
char not; not= !2;
23 . main()
printf("¾d", not);
{
}
printf(" ¾x", - 1 <<4);
(a) I (b) 2
}
(c) 0 (d) No output
(a) 0fff (b) 0123
(c) fffO (d) fffl
2 8. int i=l0;
main()
24. main()
{
{
extern inti;
inti = 5 ;
printf("%d%d% d% d%d", i++,i--,++i,--i, i);
int i= 20;
}
(a) 54545 (b) 65545
( d) Compiler Error const volatile unsigned i= 30;
(c) 45545
printf("¾d" ,i);
25 . enum color{BLACK, BLU E, GREEN };
main() printf("¾d" ,i);
{ }
printf("¾d ..¾ d .. ¾ d" ,BLACK,BLUE, GREEN);
printf("¾d" ,i);
return() ) ;
}
(a) 30,20 , I 0 (b) I 0,20,30
(a) 2 .. 1..0 (b) 0 .. 1..2
(c) 20, 10,30 (d) 20,30, I 0
(c) 1..2 .. 3 (d) Runtime Error

Recular Ll•e Doubt cleartn1 8eeel o n• I F ree Online Teet Berle• I ABK an expert
ace Affordable Fee I Available lM f I 6M I 12 M I 18M and 24 Montha S ub•~rt
online 3M ~ p t i on p ackqe■
•AIP@hhhhhiiiiQ~
2 9 . # include<stdio.h>
32. void main()
main()

static int i= 5;
const int i=4 ; if(- - i)
float j; {
j = ++i; main();

printf("¾d ¾f', i, ++j); printf("¾ d" ,i);

}
(a) 4 }
(b) 5
(a) 0 0 0 0 (b) 5 5 5 5
(c) Runtime Error ( d) Compiler Error
(c)4444 (d) 2 2 2 2

30. main()
33. void main()
{
{
inti= l_ abc(IO);
unsigned giveit= - 1;
printf(" ¾d\n", - -i);
int gotit;
}
printf("¾u" ,++giveit);
int I a bc(int i) printf("¾u \n", gotit = - -giveit);
{ }
return( i++); Assume that unsigned int range is O to 65535
} (a) l 65535
(a) 10 (b) 9 (b) I 65534
(c) 8 (d) 11 (c) 0 65535
( d) None of these

31. main()
{ 34. void main( )
{
int i =O;j =O;
static int i=i++, j =j ++, k=k++;
if(i && j ++)
printf("i = ¾d, j = ¾ d, k = ¾ d", i, j , k);
printf("¾d .. ¾ d",i++,j);
printf("¾d .. ¾ d" ,i,j);

(a) i = 1, j = 2, k = 3
(b) i = 2, j = I, k = 2
(a) 0..0 (b) 1..0
(c)i = 1, j = l ,k = 1
(c) o.. J (d) I.. I
(d) None of these

ace India'■ Be■t Onllne Coachlnc Platform for OATlt, 11:81!:, PSU■, SSC-JE, SSC, Bank■, Group■ & PSC Eu ~
onllne Eajoy a ■ mooth onUne learnlnc e•perlence lo vulou■ lanllJ ■jle■ at your convenience
-
7 iQi@000iOIOiMli@@~

35. What is the output for the program given below. 39. main()
typedef enum errorType {warning, error,
exception} error;
int i=4,j=7;
main()
j = j :: i++ && printf(" YOU CA N") ;
{
error gl ; printf("¾d ¾d", i, j);

gl=l ;
printf("¾d" ,g l );
} (a) YOU CAN
(a) l (b) Compiler Error (b) 4 7
( c) Runtime Error (d) Garbage value (c) 4 1
(d) Compiler Error
36. typedef struct error {int waming,error, exception;}
error;
40 . main()
main()
{ {

error gl; struct student


gl .error = l ;
printf("¾ d" ,g I .error); char name[30] ;
}
struct date dob;
(a) 1 (b) 2 (c) 3 (d) 4
}stud;

37. main() struct date

{ {
inti =5; int day,month,yea r;
printf ("¾d", i= ++i = = 6); };
}
scanf("¾s ¾ d ¾ d ¾ d", stud.rollno,
(a) l (b) O (c) 6 (d) 5
&studen t.dob.day,&studen t.dob. month,

38. main() &student.dob. year):

{
int i= 10,j =20;
j = i, j?(i,j)? i:j :j ; (a) Runtime Error
printf("¾d ¾ d", i,j); (b) Compiler Error
} (c) Linker Error
(a) l O 20 (b) 10 10
(d) No output
(c) 20 30 (d) 20 20

Re1ular Live Doubt clearln1 Se ■■ lon• Free Online Teet Be rl e■ I ASK • n exp o rt
ace I I I 6M j 12M I 18M and 24 Month■ S ubacrlptlo n Pa ckag es
online Affordable Fee Available lM 3M
r ,
8 iFMliliillili4MINY~
Functio ns: 44. main()
{
41. #define square(x) x*x show();
main() }
{
void show()
inti;
{
i = 64/square( 4);
printf("I'm the great~st");
printf("¾d " ,i);
}
}
(a) I'm the greatest (b) Compiler Error
(a) 64 (b) 4
( c) Runtime Error ( d) None of these
(c) 16 (d) None of these

45. # include<std io.h>


42 . main()
{ aaa()
inti =1; {
while (i<=5) printf("hi ");
{
}
printf("¾d " ,i);
bbb()
if(i>2)
goto here; {

i++; printf("hell o");


} }
} ccc()
fun()
{
{
printf("bye ");
here:
prin tf("pp "); }

} main()
(a) 5 (b) PP
( c) Compiler Error ( d) Runtime Error int (*ptr[3])( );
ptr[0]=aaa;
43. #define f(g,g2) g##g2 ptr[ l ]=bbb;
main()
ptr[2]=ccc;
{ int var! 2 = I 00;
ptr[2]();
printf("¾d ", f(var, 12));
}
(a) 100 (b) 90 (a) aaa (b) bbb
(c) 95 (d) None of these (c) he llo (d) bye

!Yace India'• Beat Online Coachl n1 Platform for GATE, ESE, P8Ua, 88C-J£, 88C , Banke, Groupe & PSC E:a:ama
~ online En.Joy a •moo tb o nlln e leamln1 ea:porience tn varioua lan&u•1•• at your convenience
jalEA_.C~ - 9 ;QHM60000i410Nid~

46. main() 48. #define prod(a,b) a*b


{ main()
char a[l00]; {

a[0]= ' a '; int x=3,y=4;

a[l]= 'b' ; printf("¾d", prod(x+2,y-l ));

a[2]= ' c '; }


(a) 7 (b) 10
a[4] = ' d' ;
(c) 8 (d) 12
abc(a);
}
49. #define DIM( array, type) sizeofl:array)/si zeof(type)
abc(char a[ ])
main()
{
{
a++;
int arr[l0] ;
printf("¾c", *a);
printf("The dimension of the array is % d",
a++; DIM(arr, int));
printf("¾c", *a); }
} (a) 20
(a) be (b) ca (b) 10
(c) cd (d) ad ( c) Runtime Error
( d) Compilation Error

47. vo id main()
50. int DIM(int array[ ])
{
{
int k= ret(sizeof(floa t));
return sizeof(array)/ sizeof(int );
printf("\n here value is % d", ++k);
}
}
main( )
int ret(int ret)
{
int arr[l0] ;
ret + = 2 .5;
printf("The dimension of the array is % d",
return(ret);
DIM(arr)) ;
} }
(a) 2 .5 (b) 6 (a) 0 (b) 1
(c) 7 (d) 5 (c) 3 (d) 5

Re1 ular Llve Doubt clearln1 Seaalon■ I Free Online Te ■t Berle ■ I ASK an ezpert
ace Affordable Fee I Available lM I 3M I 6M I l~M I 18M and ~4 Month■ &ub■crlpj:lon Packace■
online
10
iiNY@ihhOOAMO@h~

5 1. char *someFunl () int next (int j)


{ {
char temp[ ] = "string"; return (j = i+ +) ;
return temp ; }
int last (int j)
char *someFun2() {
{ static int i= 10;
char temp[]= {'s' , ' t' , ' r ', ' i', ' n ', ' g'}; return (j = i - -);
return temp;
}
}
int new (int i)
int main()
{
static int j = 1;
puts(someFunl( ));
return (i+ = j + +);
puts(someFun2( ));
}
}
The output of the above program is_ __
(a) Error (b) string
(c) Compiler Error (d) Garbage value
53. Consider the code fragment written in C below:
void f (int n)
52. int i = I ;
{
main ()
{ if (n <= 1)

auto inti, j ; {
i = reset ( ); printf(" ¾d" ,n);
fo r (j = 1; j <=3; j + +)
{ else
printf(i, j); {
printf(next(i)); f(n/2) ;
printf(last(i)); printf(" ¾d" ,n%2);
printf(new( i + j));
}
} }
} What does f ( l 73) print?
int reset (void)
(a) 010110101
{
(b) 010101101
return (i);
(c) 10110101
(d) 10 10 11 01
N Tace India'• Be■ t
Online Coachln1 Platform fo r GATE, ESE, PSUa, SS C-J E, SSC, Banlu, Group• & PS C Exam•
'---~---=-_o,!_!n~ll!n
!. . !.:e~ _ J_____E_:nj....:oy:.....__a_• m_ o_o_th_ on1_1_n_e _le_ar_n_ln-=''-e_xp:_e_rt_e_nc_e_l_n _• a_rl_o_u_. _1a_n:::..._
cuai .=.e_•_•_t _;_
yo_ u_r_c_o n
_ v....:.
e....:.
nl_e_n c_e_ _ __
11 iQdN@i!OOOiYiiiMihM~

54. Consider the program below in a hypothetical main()


programming language which allows global {

variables and a choice of static or dynamic struct Data *ptr;


ptr = malloc (sizeof (struct Data ));
scoping.
ptr = NULL;
int i;
ptr .-d : = 5.2;
program main( )
printf(" ¾f' , *ptr);
{
}
i ::, 10; (a) The program leads to compile time error
ca ll f( ); (b) The program leads to runtime error
} (c) The program outputs 5.2
procedure f() (d) The program produces error relating to null
pointer dereferencing
{
int i=20;
call g( ) ; Pointers:
}
56. void main()
procedure g()
{
{
int const * p = 5;
print i;
printf(" ¾d", ++(*p));
} }
(a) Compiler Error (b) 5
Let x be the value printed under static scoping and ( c) Runtime Error (d) 6
y be the value printed under dynamic scoping.
Then, x and y are 57. main()
(b) x = 20, y=lO {
(a) x= IO, y = 20
(d) x = 20, y = 20 chars[ ] = "man";
(c)x= 10, y= JO
int i;
for(i = O;s[i] ;i++)
55 . For the program segment given below, which of
printf("\n¾ c¾ c¾ c¾c",s[i], *(s+i), *(i+s), i[s]);
the following are true? }
struct Data (a) mmm (b) mmmm
aaa aaaa
float d ; nn nnn
(c) mmmm (d) aaa
struct Data *link;
aaaa nnn
};
nnnn
Re&ular Live Doubt clearln& Be-■lon■ I Free Online Te at Se rie ■ I ASK a n e xpert
ace I I l:2M I 18M and :24 Month■ Sub■cripUon Packa ges
online Affordable Fee I Available lM I 3M 6M
,PUNilhhihiiih&li~
58. main()
61. main()
{
{
char *p;
static char names[5][20]={"pascal", "ada",
printf("%d", sizeof(*p),sizeof()); "cobol", "fortran", "perl"};
}
inti;
(a) 1 2 (b) 2 I
char *t;
(c) 2 3 (d) 3 2
t = names[3];
names[3]=names[ 4];
59. main()
names[4] = t;
{
for (i = O; i<=4;i++)
char string[ ] = " Hello World";
printf("%s", names[i]);
display(string);
}
}
(a) pascal
void display( char *string)
(b) perl
{
(c) fortran
printf("%s" ,string);
(d) Compiler Error
}
(a) Runtime Error (b) Hello World
62. #include<stdio.h>
( c) Compiler Error ( d) None of these
main()
{
60. #include<stdio.h>
struct xx
main ()
{
{
int x=3 ;
struct xx
char name[ ]="hello";
{
};
int X = 3;
struct xx *s=malloc(sizeof(struct xx));
char name[ ]= "hello";
printf("%d",s-x);
};
printf("%s" ,s-name);
struct xx *s;
}
printf("%d",s ___. x);
(a) 3
printf("%d",s - name);
(b) hello
}
(b) Complier Error (c) Compiler Error
(a) Hello
(d) Runtime Error (d) Runtime Error
(c) 3

rvr ace India'• Beat Online Coachln1 Platrorm (or GATE, ESE, PSUa, 8SC-JE, SSC, Banke, Groupe Ill PSC Exam•
~ online Enjoy a amooth onllne learnln1 ezperlence In v arioua Iancu•1•• at your co nvenJence
13 •Pi@Bhhhiii4MiiNlh~
63. Assume that base address of array is 100 and 65 . main( )
integer occupies '2' bytes then the output is {
main() static int a[]= {0,1,2,3,4};
{ int *p[] = {a,a+l ,a+2 ,a+3,a+4 };
int a[2][3][2]={ { {2,4}, {7,8}, {3,4 } },{ {2,2}, int **ptr= p;
{2,3}, {3,4} }}; ptr++;
printf("%u%u%u%d\n" a *a **a ***a)· printf("\n¾d¾d¾ d", ptr-p, *ptr-a, * *ptr); *ptr++;
' ' ' ' '
printf("%u%u%u%d\n" a+ 1 *a+l **a+l printf("\n¾d¾d¾ d", ptr-p, *ptr-a, **ptr);*++ptr;
' ' ' '
printf("\n¾d¾ d¾ d", ptr-p, *ptr-a, **ptr);++*ptr;
***a+l);
} printf("\n ¾d ¾d ¾d", ptr- p, *ptr-a, **ptr);
}
(a) I 00, 100, 100, 2
(a) 111 , 222,333, 444 (b) 444, 333, 222, 111
112, 104, 102, 3
(c) 111,222, 333 , 344 (d) Compiler Error
(b) 2, 100, 108, 100
104, 110, 100, 3
66 . main()
(c) 100, 2, 100, 2
{
3, 114, 104, 100 vo id *vp ;
(d) 100, 100, 2, 100 char ch = ' g' , *cp = " goofy";
114, 104, I 02, 3 int j = 20;
vp = &ch;
64. main() printf("¾c", *(char *)vp);
{ vp = &j ;
int a[] ={ 10, 20, 30, 40, 50}j,*p; printf("¾d", *(int *)vp );
for (j=0 ; j < 5; j ++) vp = cp ;
{ printf("¾s",(char *)vp + 3);
printf("%d", *a); }
(a) g20fy (b) goofy
a+ +;
(c) goofy20 (d) goo20
}
p = a;
67. main()
for(j = 0; j <5; j++)
{
{ char *strl = " abed";
printf("%d", *p );
char str2[ ] = "abed";
p++; printf("¾d ¾ d¾ d", sizeof(strl ), sizeof(str2),
} sizeof("abcd"));
} }
(a) 10 (b) 50 (a) 2 5 5 (b) 5 2 5
(c) Compiler Error ( d) Runtime Error (c) 5 5 2 (d) Compiler Error
Regular Live Doubt clearing Se-■lon■ I Free Online Te■t Serie■ I ASK an ezpert
ace Affordable Fee I Available lM I 3M I 6M I l2M I 18M and 24 Month■ Sub■crlptlon Package■
online
•PiiMFhi!w\h◄Mii@Ft~
68 . ma in() (a) 3 (b) Compiler Error
{ (c) Runtime Error (d) Garbage value
int *j;
{ 71. main()
int i = 10 ; {
j = &i ; char *p;
}
p="¾d\n";
printf("¾d" ,*j);
p++;
}
p++;
(a) 10 (b) Compiler Error
printf(p - 2,300);
( c) Runtime Error (d) None of these
}
(a) 302 (b) 300
69. struct point
(c) 304 (d) 298
{
int x;
int y; 72. void main( )

}; {
struct point origin, *pp; void *v;
main() int integer= 2;
{ int *i = &integer;
pp=&origin;
V = i;
printf("origin is (¾ d, ¾d)\n",(*pp).x,(*pp ).y);
printf("¾d" ,(int*)*v );
printf("origin is (%d,%d)\n", pp-x, pp-y);
}
}
(a) originis(0; l) (b) origin is (0,0) (a) 2

origin is (1,0) origin is (0,0) (b) Compiler Error


(c) Runtime Error (d) Compiler Error (c) Runtime Error
(d) None of these
70. # include <stdio.h>
int one_ d[ ]= { I ,2,3}; 73. main( )
main()
{
{
int a[ 10] ;
int *ptr;
ptr=one_d; printf("¾ d" ,*a+ 1- *a+ 3);

ptr+==3; }
printf("¾d", *ptr); (a) 1 (b) 2
(c) 3 (d) 4

,-Y, a ce India' ■ Be■ t Online Co achin& Platform for GATE, ESE, PSU■ , SSC-JE, SSC, Bank ■ , Group ■ & PSC Exams

~ online Enjoy a ■mooth o nllne learnln& experience In varlou■ lanpa&e■ at your convenience
15 iQIMFIOhih!AMO@w~
74. What is the output for the following program? (a) Garbage value, zeros
main()
(b) Compiler Error
{ (c) Runtime Error
int arr2D[3][3] ; (d) None of the above
printf("%d\n" ,((arr2D== *arr2D)&&
(*arr2D = = arr2D[0]))) ; 78 . main()
} {
(a) 0 (b) I int a = 2, *fl, *£2;
(c) 2 (d) 3 fl= f2 = &a;
*f2+=*f2+=a+ =2.5;
75. main() printf("\n¾d ¾d ¾d", a, *fl , *£2);
{ }

char *p = "ayqm"; (a) 16 16 16 (b) 15 16 15

printf("¾c", ++*(p++ )); (c) 15 15 16 (d) 16 15 16

}
79. main()
(a) b (b) ayqm
(c) d (d) Compiler error
char *p="GOOD";
char a[ ]="GOOD";
76. main()
printf("\n sizeof(p) = ¾ d,
{
sizeof(*p) = ¾ d,
char P[ ] = "ayqm";
strlen(p) = ¾ d",
char c; sizeof(p ), sizeof(*p), strlen(p));
C = ++*P; printf("\n sizeof(a) = ¾ d, strlen(a) = ¾ d",
printf("%c", c ) ; sizeof(a), strlea(a));
} }
(a) aygm (b) g The output of the above program is _ _ .
(c) b (d) y
80. main()
77. void main( ) {
{ int i = 257;
int *mptr, *cptr; int *iPtr = &i;
mptr = (int*)malloc( sizeof(int)); printf("%d%d" , *(( char*)iPtr), *(( char*)iPtr+ I));

printf("%d", *mptr); }
int *cptr = (int*)calloc(s izeof(int), I);
printf("%d", *cptr); (a) 1 I (b) 1 2
(c) 2 I (d) None of the above
}
Recular Liv e Doubt c l earl n&Se ■■ lon• I P'ree Online Teat Serie• I ASK an eapert
ace Affordable P'ee I Available lM I 3M I 6M I llM I 18M and l4 Mo n t h• S ubacrlptlon Packae:e•
online
•PdMFl!OhhiMMi@ih~

81. main() (a) Runtime Error


{ (b) Compiler Error
int i= 300; ( c) Linker Error
char *ptr = &i;
(d) No output
*++ptr=2;
printf("%d" ,i);
85. Is the following code legal?
}
struct a
(a) 552 (b) 550
(c) 556 (d) 558
int x;

82 . # include <stdio.h> struct a *b;


main() };
{
char * str = "hello"; (a) Yes (b) No
char * ptr = str;
char least = 127;
86. Is the following code legal?
while (*ptr++)
typedef struct a
least = (*ptr< least ) ? *ptr : least;
printf("%d" ,least) ;
} int x;

(a) o (b) e aType *b;


(c) llo (d) h }aType

83. What is the declaration of an array of N pointers


(a) Yes (b) N o
to functions returning pointers to functions
returning pointers to characters _ __ _
87. Is the following code legal?

84. What is the suitable error in the following code typedef struct a a Type;

segment? struct a

void fun(int n, int arr[ ]) {

{ int x;
int *p = O; aType *b;
inti = O; };
while(i++<n)
p = &arr[i] ;
(a) Yes (b) No
*p = 0;

India '■ Beat Online Coachln,: Platform for GATE, ES E, PSU■ , SSC-JE, SSC, Bank■ , Group ■ & PSC Exam•
!Y ace
~ online Eajoy a ■mooth o nline l earhln,: ~erlence In varlou■ lan,:uar;e• at your conveD.ience
17 •PdMiihOOOMMh@h~
88. Is the following code legal? 91. Is this code legal?
void main() int *ptr;
{ ptr = (int *) 0x400;
typedef struct a a Type;
aType someVariable; (a) Yes (b) No
struct a
{ 92 . main()
int x;
aType *b; int a= 10,*j;
}; void *k;
} j = k = &a;
(a) Yes (b) No j++;
k++;
89. void main() printf("\n %u %u", j, k);

printf("sizeof (void*)= %d \n", sizeof(void *)); (a) address of a twice


printf("sizeof (int*) = %d \n" ,sizeof(int *)); (b) 10, 10
printf("sizeof(double*)=¾d\n", sizeof(double*)); (c) Compiler Error
printf("sizeof(struct unknown*) = %d \n", (d) 11, 11
sizeof(struct unknown *));

} 93 . char *somefun()
If the pointer size is 2 bytes then the output of the
above program is _ _ . char *temp = "string constant";
return temp;

90. void main( )


{ int main()

int i= l 0, j =2 ;
int *ip= &i, *jp = &j ; puts( somefun() );

int k = *ip/*jp;
printf(" ¾ d",k); (a) Error
(b) Runtime error
}
(b) 10 (c) Compiler Error
(a) 5
(d) 2 ( d) String constant
( c) Compiler Error

Re&ular Live Doubt clearln& Be■■lon1 I Fre e Online Te1t Serie ■ I AS K an expert
ace Affordable Fee I Available 111 I 3M I 6M I 12 M I 1 8M and 2 4 Month■ Bu b1crlptlon Paclr.acee
online
iPMiiidliiiiMIIAli~
94. main() 96. main()
{ {

int num[ ] = {24, 34, 12, 44, 56, 17}; int stud[5][2] = {
{1234, 56},
inti = 0, *j ;
{1212,33},
j = &num[0] ;
{1434, 80} ,
while (i <= 5)
{1312, 78} ,
{
{1203, 75},
printf("\n address= %u", &num[i]);
};
printf("element = %d", *j);
int i,j;
i ++ ; for (i = 0; j<=4; i ++)
j++; printf("\n Address of %dth 1-D array =
} %u" , i, stud[i]);
} }
If base address of array is 65514 and integer Assume that base address of array is 65506 and
occupies '2' bytes then output of the above integer occupies '2' bytes then output of the
program is _ _ __ above program is

97. main()
95. main()
{
{
int stud[5)[2] = {
int num[ ] = {24, 34, 12, 44, 56, 17};
{1234, 56},
display(&num[0], 6);
{1212, 33 },
}
{1434, 80},
display(int *j, int n)
{1312, 78 },
{1203, 75 },
inti = I ; };
w hile (i <=n) int i,j ;

{ fo r (i = 0; i<=4 ; i ++)

printf("\n element = % d", *j); {


printf("\n");
i++;
j ++;
for U = 0; j <= l ; j ++)
printf("¾d", *(*(stud + i) +j));

O utput o f the a bove program is _ __


Ou tput o f the above program is _ _ _

[ 1',11 ace l ndla'a Beat On lin e Coaching Platform for GATE , ESE, PSUa, S SC-J E, SSC , Banke, Groupe • P SC Eaam a

~ online Enjo y a amoolh onUne learnl n & cnrp e rle nce In varlo ua lancua &• • a t :,o ur c onYenJence

~
;;,aqaoo,,0,11+1,mw~
98. main() 101. main()
{ int a[3][4] = { {
5, 7, 5, 9, int arr[]= {O, 1, 2, 3, 4 };
4, 6, 3, 1,
int *ptr;
2, 9,0, 6
for (ptr = &arr[O]; ptr<=&arr[4]; ptr++)
};
int *p; printf (" ¾d" , *ptr);
int (*q)[ 4]; }
p = (int *) a ; Output of the above program is _ _ .
q = a;
printf("\n ¾ u ¾ u", p,q) ; 102. main()
p++; {
q++; int arr[]= {0, 1, 2, 3, 4 };
printf("\n ¾ u ¾ u", p,q) ; int i, *ptr;
}
for (ptr = &arr[0] , i = 0; i <= 4; i++)
If the base address of array is 65502 then output
printf (" ¾d" , ptr[ i]);
of the above program is _ _ .
}
99. main() Output of the above program is _ _ .
{
static int a[]= {0, 1, 2, 3, 4 }; 103. main( )
static int *p[ ] = {a, a+ 1, a+2, a+ 3, a+4}; {
printf("\n ¾u ¾ u ¾d", p, *p, *(*p)); int arr[]= {O, 1, 2, 3, 4} ;
} int *ptr;
If base address of 'a' is 170, base address of 'p' is for(ptr = arr + 4, ptr >= arr; ptr- - )
180 then output is _ _ __ printf ("¾d", arr[ptr-arr]) ;
(a) 0l70180 (b) 180 170 0 }
(c) 170 0 180 (d) 0 180 170 Output of the above program is - - -

100. main() 104. main()


{ {
int b[] = {10, 20, 30, 40, 50 }; static int a[] = {0, 1, 2, 3, 4 };
inti , *k; static int *p[] = {a, a+ ! , a+2, a+3, a+4} ;
k = &b[4] - 4 ;
int **ptr = p;
fo r(i = 0; i<=4 ; i++)
printf (" \n ¾ u ¾ d" , a , *a);
{
printf ("¾u ¾ u ¾ d", p, *p, **p);
printf("¾d" , *k);
printf ("\n ¾ u ¾ u ¾ d'' , ptr, *ptr, **ptr);
k++ ;
}
If the address of 'a' is 170 , and address o f 'p' is
Output of the above program is _ _ 180 then output o f the above program is
Recular Live Doubt clearln1 Seaalon a I P ree Onllne T eat Serl e a I ASK a n e:apert
~ ace Affordable P'ee I Available I 3M I 6 M I UM 118 M and 2 4 Month• Subsc ription Packages
~
111
online
iQi®@OUOOhll11M~

105. main() Control Statements:


{
static int a[ ] = {0, I, 2, 3, 4};
static int *p[] = {a, a+ I, a+2, a+3, a+4}; 107. main( )
int **ptr = p; {
ptr++; float me = 1. I ;
printf ("\n %d %d %d",ptr- p, *ptr- a, **ptr); double you = 1. 1;
*ptr++;
if(me == you)
printf ("\n %d %d %d",ptr- p, *ptr- a, **ptr);
printf("I love u");
*++ptr;
printf ("\n %d %d %d",ptr- p, *ptr-a, * *ptr); else
++*ptr; printf(" I hate u");
printf ("\n %d %d %d" ,ptr- p , *ptr-a, * *ptr); }
} (a) I love u (b) I hate u
Output of the above program is _ _ _
(c) I love u I hate u (d) None of these

106. main( )
L
{ 108. main()
a
static int a[3] [3] = { {
I, 2, 3, int c[] = {2.8, 3.4,4, 6.7, 5};
4, 5, 6,
int j, *p = c, *q = c;
7, 8, 9
forU = 0;j<5;j + +)
};
static int *ptr[3] = {a[0], a[l], a[2]} ; {
int **ptrl = ptr; printf("%d", *c);
inti; ++ q;
for(i = 0; i<= 2; i++) }
I
printf ("%d" , *ptr[i]);
forU = 0; j < 5;j + +)
printf ("\n");
{
for (i = 0; i<=2; i++)
printf ("%d", *a[i]); printf("%d", *p );
printf ("\n"); + + p;
for (i = 0; i<=2; i++) }
{ }
printf(" %d", **ptrl);
(a) 2 2 2 2 2 3 3 4 6 5
ptrl ++ ;
(b) 2 2 2 2 2 2 3 4 6 5
}
(c) 2 2 2 2 5 5 3 4 6 5
}
Output of the abo ve program is _ _ (d) 2 2 2 2 3 3 3 4 6 5 I
tv, ace India 's Beat Onlin e Co a c hing Platform for GATE, ESE , PSUa, SSC-JE, SSC, Banka, Group• & PSC £llama

~ online EnJoy a smooth onllne learning ellperl ence In varloua lancuace• at your convenience
iPMIOOIOOAMOM!h~

109. main( ) (a) Ok here (b) Forget it


{ int i = 3; ( c) Compiler Error ( d) Runtime Error
switch(i)
{ 112. void main()
default:printf("zero");
{
case 1: printf(" one");
while(l)
break;
case2: printf("two"); {

break; if(printf("%d", printf("%d")))


case3 :printf(" three"); break;
break; else
} continue;
} }
(a) one (b) three
}
(c) two (d) zero
(a) Garbage value (b) Compiler error
(c) Runtime Error (d) None of these
110. main()
{ l I 3. main()
int y ;
{
scanf("%d" , &y); II input given is 2000
unsigned int i = 1O;
if( (y%4=0&& y%100 !=0)::y%100 = = 0)
printf("%d is a leap year"); while(i- - >= 0)

else printf("%u", i);


printf("%d is not a leap year"); }
} (a) 10 (b) 9
(a) 2000 is a leap year ( c) infinite loop ( d) Compile time error
(b) 2000 is not a leap year
( c) Runtime Error 114. # include<conio.h>
(d) Compiler Error main()
{
11 1.void main()
int x,y = 2, z, a;
{
if(x = y%2)
int i;
char a[) = "\0"; z = 2;
if(printf("%s\n" ,a)) a = 2;
printf("Ok here \n"); printf("%d %d ",z, x);
else }
printf("Forget it\n");
(a) Garbage value, 0 (b) Compiler Error
(c) Ru ntime Error (d) None of these
Recular Llve Doub t cle arlo c S e Hlon• I Fre e Online Teat Serie • I ASK an e:apert
ace Affordable Fee I Available 1111 \ 3 M I 6 11 I llll I 18M and l4 Month• Subacrlption Pacbce•
online
•P•MiihhhhAMOMih~

115. main() (a) Infinite loop


(b) O
un signed int i=65000; (c) Compiler Error
while(i++ !=0); (d) Runtime Error
printf(" ¾ d", i);
} 119. main()
(a) I (b) 65000 {
(c) 2 (d) 65001 while (strcmp("some", "some\0"))
printf("Strings are not equal\n" );
116. main() }
{ (a) Some
inti = 0; (b) Strings are not equal
while(+(+i- - ) ! = 0) ( c) Compiler Error
i - = i++; (d) No output
printf( "¾ d", i);

120. main()
(a) I (b) 2
{
(c) - I (d) 0
inti= 3;
for (;i++ =0;) printf("¾d",i);
I I 7 . What is the output of the program given
below? }

main() (a) 3 (b) 4

{ ( c) Compiler Error (d) No output

s igned char i= 0;
for(;i >=O;i++) ; 121 . void main( )
printf("¾d\n" ,i);
static int i;
(a) - 128 (b) 128 while(i <= 10)
(c) 127 (d) - 127
(i > 2)? i++: i- - ;
printf("¾d", i) ;
I 18. ma in()
}
(a) 32767
unsigned char i=0;
(b) 32768
fo r( ;i>=0 ;i++) ;
(c) 32770
rrintf("%d\n" ,i );
(d) None of the above

A_;,; QCe - lµdla'a Be■t Online Coachlnc Platform for GATE, ESE, PSU■ , SSC-JE, SSC , Banks, Groupe & PSC Esam•

l
- - ~ - Q~n.:::;l:.:.in..;.=
e-_...,_____E_rtj:__o.::_y_a_•_m_oo_ t_b_o_nU_ n_e_le_•_rni
___:
n,
=-e- •-=-
P_e rl
_ e_n_ce_ l_n_v_u_lo
_ u_•_la_n.=
c_ua-=':_
e•_ •_t..:..y_ou
_ r_c_o_n v_e_n_le_nc_ e_ _ __ ,
iMi@?IMhhi4ii,M1&'"°9
l .::!2. main() Paramete r passing techniqu es:
{
float i= l. 5 ; 124. Aliasing in the content of programming languages
switch(i) refer to
{ (a) Multiple variables having the same memory

case l : printf(" I " ); location


(b) Multiple variables having the same value
case 2 : printf("'2 ");
(c) Multiple variables having the same identifier
default : printf("0");
( d) Multiple uses of the same variable
}
}
125. Consider the following program in which the
(a) 0 (b) l
parameter passing might not be limited to call by
(c) 2 (d) Compiler Error value and call by reference.
Program Parameter_ Passing;
123. #<lefine assert(cond) if(!(cond)) a . b: integer;
(fprintf(stderr, "assertion failed: %s, file % s, line Procedure P(x , y : integer)

%d \n",#cond,\_F ILE_ ,_LrNE), abortO) {


X = X + 2;
void main()
a= X * y;
{
x=x + l ;
inti = l0;
}
if(i= O)
main ( )
assert(i < I 00) ; {
else a= l ;
p rintf("This statement becomes else for if b = 2;
in assert macro"); P(a, b);

} write(a);

What is the Output?


(a) This statement becomes else for if in assert Under which of the following parameter-pa ssing
mechani sms will the output of the program be 4?
macro
(a) call-by-value
(b) 10
(b) call-by-refe rence
(c) print the values between 10 to I 00
(c) call-by-name
(d) No output
(d) call-by-va lue-result

Replar Lh•e Do ubt c learlA& Seulo.,. I Free OnUne Teat Serlea I ASK an u :pert
ace Affordable Fee I AY&ilabl e 114 I 314 f 611 I 12M I l 8M and :J4 Month.a Subac rlpt l on p ac-.ace•
._
online
;Uh@hihhhhAl!iMI~

126. In the following function , X is passed by funcf (int x)


reference and Y is passed by value : {
P( X : integer ; Y : integer) int y;
{ y = funcg (x);

K = 3; return (y);
}
L = 5;
funcg (int x)
return (X + Y);
}
static int y = IO;
If the function P were invoked by the following
y += l ;
program fragment
return (y + x);
K := I;
}
L = I; (a) 43 80 (b) 42 74
Z = P(K, L); (c) 33 37 (d) 32 32
Then the value of Z would be equal to
(a) 2 (b) 3 (c) 4 (d) 8 02. void func(void);
int main (void)
{
Level-2 Questions
printf ("Lucknow\n");
goto ab;
return 0;
Functions:
}
void func (void)
0 I . What is the output of the following program?
{
#include <stdio.h>
ab:
int funcf (int x);
printf ("Bareilly\n");
int funcg (i nt y);
}
main ( )
{
03 . void func (int a, int b);
int x = 5, y = 10, count;
for (coun t= I; count <= 2; ++count) int main (void)
{

y+ = funcf(x) + funcg(x) ; int x;

printf ("¾d", y); x=func (2,3);


return 0;
}

ace India' ■ Be ■ t Online Coachln& Platform for GATE, 11:811:, PBU■, 88C-JII:, 88C, Bank■ , Group■ a. PSC Exam•
online Eajoy a ■mooth onllna leunln& upertence In 'Hriou■ lancuece■ at your con•Hnlence
25 •Ai®ihhhih@ih@lh1

void func (int a, int b) 06. int main (void)


{ {
int s; int s;
s = a+ b ; s=func( 1,2);
return; printf ("¾d\n",s);
} s = func (1,2,3,4);
printf ("%d\n",s);
04. int func ( void); return 0;
int main (void) }
{ int func (int a, int b, int c)
int x=l0; {
x=func(); return a+b+c;
printf("¾d\n" ,x); }
return 0;
} 07. int sum (int x,int y);
int func (void) int multiply (int x , int y);
{ int main (void)
printf (" Function\n"); { int m=6,n=3;
} printf ("¾ d\t", multiply (m,n));
printf ("¾ d\t" , multiply (15 ,4));
05. int add (int x,y,z) printf("¾ d\t" , multiply ( m+n, m-n));
{ printf ("¾d\n",multiply (6,surri (m ,n)));
return x+y+z; return 0;
} }
int main (void) int multiply (int x, int y)
{ {
int sum; return x*y;
sum=add (1 ,2,3);
}
return 0; int sum (int x, int y)
} {
return x+y ;
}

Resular Ll•e Doubt clearln1 8e■-lon• I Free Online Te ■t 8■ rle• I ABK an ellpert
ace Affordable Fee I A•allable 111 I 3M I 6 M I 12 M 11811 and 24 Month■ Sub■crlptlon Packa&e■
online
ilM61161Miil@i1
08. int func (int x ,int y); 11 . void func (int x, int y);
int main (void)
int main(void)
{
{
int p=func (5 ,6);
int x;
printf ("%d" ,P);
x=func (5,6)+100;
return O;
printf ("%d",x);
}
int func (int x,int y) return O;

int x=2; void func (int x, int y)


return x*y;

int z;
Z = X + y;
09 . int min (int a, int b) ;
int main(void)
{
12. int diff (int x, int y)
int a= IO, b=5;
printf ("%d\n" ,min(a,b )); {

return O; return x-y;


}
int min (int a, int b) int sum (int x, int y)
{
a<b? return a: return b;
return x+y;

int main (void)


10. int max (int a, int b)
{

return a>b? a:b; inta=20, b=5 , c=2, d=6;


)
I
printf ("%d\t", a+diff (d,c ));
int main (void) printf("%d\n",diff (a,sum (diff (b, c), d)));
f
l retu rn O;
int a=2 , b=8, c=3;
printf ("%d\n", max (a, max(b,c)));
return O;

~ ace lndla'■ Beat On lin e Coa chln1 Platform for GATE, £1111:, PIIU■, 8110-JS, 8110, Baaka, Group■ a, P8C Sa• 111•
~- ~~
L____:_:::== Online
=-=-.c..:=.- Enjoy
- - ' - -- - - - a ■mooth onllne leamln& eaperlence In 'Hrloua la.n&11a1ea at your conye aJence
iPMhiiiiiiidG~
08. int func (int x,int y); 11 . void func (int x, int y);
int main (void)
int main(void)
{
{
int p=func (5,6);
int x;
printf ("¾ d" ,p);
x=func (5,6)+100;
return O;
} pn·ntf ("¾od" , x) ,·

int func (int x,int y) return O;


{ }
int x=2; void func (int x, int y)
return x*y;
}
int z ;
Z = X + y;
09 . int min ( int a, int b);
int main(void)
{
12. int diff (int x, int y)
int a= IO, b=5;
printf ("¾d\n",min(a,b)); {

return O; return x-y;


}
int min (int a, int b) int sum (int x, int y)
{
a<b? return a: return b;
return x+y;
}

int main (void)


IO. int max (int a, int b)
{
{
return a>b? a:b; inta=20, b=5, c=2, d=6;

} printf ("¾ d\t", a+diff (d,c));


int main (void) printf("¾d\n",diff (a,sum (diff (b, c), d)));
return O;
int a=2, b=8, c=3;
printf ("¾ d\n", max (a, max(b,c)));
return O;
}

rYt ace India'■ Be■t Online Coachln& Platform for GATE, EBE, PBU■, SSC-.JE, SSC, Bank■, Group■ • PSC EZ&JD•
~ online Enjoy a ■mooth onllne lea.mine eKperlence In varlou■ languace1 at your convalllence

27 ;;o@hihhiihi441•~

13. intsqr(intx); 15. int sum(int a, int b);


int cube (int x); int main (void)
int func (int n) ; {
int main (void) (void) sum ( 1,2);
{ return O;
int n=S;
}
printf ("¾d\n",func (n));
int sum (int a, int b)
return O;
{
printf ("Sum is ¾d\n", a+b );
int sqr (int x)
return a+b;
}
return x*x;

I 6. int square 1 (int a);


int cube (int x)
double square2 (double a);
{
int square3 (int a);
return x*x*x;
doub le square4 (double a) ;
}
int mai n (void)
int func (int n)
{
{
return n+sqr (n-2)+ cube (n-3); double x=2.5 , y;
y = square 1 (x);
printf ("% 1f\t" , y) ;
14. int func (int a, int b, int c); y = square2 (x);
int main (void) printf ("% 1f\t" , y);

{ y = square3 (x);
int x= 1, y=2, z=3, resu lt; printf ("% 1f\t", y);
result = func (x,y,(z=S, z+ lO)); y = square4 (x);
printf ("x=¾d, y=¾d, z=¾d", x, Y, z); printf ("% 1f\t", y );
printf ("result=¾d\n", result); return O;
return O; }
} int squarel (int a)
func (int a, int b, int c) {
{ return a*a;
return 2* (a+b+c);
}

Re ,;ular Live Doubt c learln,; SeHlone Free Online Te at S e rie • I ASK an exp ert
~ ace Affordable Fe e I Available lM I 3M I 6M I 12M I 18M and 24 Mon th• Subacription Packages
~ online
iFIIMl@dfhPMiii ~

double square2 (double a) 19. void func (void);


{ int main(void)
return a*a; {
} inti = 5;
int square3 (int a) for (i=i+ l ; i<8; i++)
{ func O;
return a*a ; return O;
}
}
double square4 (double a) void func (void)
{
{
return a*a; int j ;
} for (j= l ; j<3; j++)
printf ("%d\t", ++j);
17. int main (void)
}
{
int func (int a, int b) 20. int func (int a, int b ) ;
{ int main ( void)
return (a+b); {
} int i=2, j=3;
int c; printf ("%d\n", func (i, j));
c = func (3,5);
return O;
printf ("%d", c);
}
return O;
int func (int a, int b)
}
{
a= a -5 ;
18. void display (int, int);
b = b + 5;
int main (void)
return (!a + - - b);
{
}
int x=l5;
float y=290.5;
21. int func (int a, int b, int c );
display (x,y);
int main (void)
return O;
{
}
int x;
void display (int a, int b)
x=func (2, 3, 4);
{
printf ("%d\n", x);
printf ("%d %d\n", a, b);
return O;

ace lndla'■ BHt Onllne Coachlnc Platform for GATE, ESE, PSU■, SSC-J S , SSC, Bank■ , Group•• PSC ham•
online Enjoy • amooth onllne lea.min& e,rpertence In vartou■ tanaua1e• at yow convenlence

29 ;;1@@ihhhhiih@h~
int func (int a, int b, int c) 24. int func (int x, int y);
int main (void)
return a, b, c;
{
}
int a=2, b=5;
a= func (a+b, a - b);
22. void func (int a, int b );
printf ("%d\n", a);
int main (void)
return O;
{
int i=5, j = l O;
int func (int x, int y)
func (i/2, j%3);
{
return O;
return x+y, x-y;
}
}
void func (int a, int b)
{
25 . int func (int k);
a/=2; int main (void)
b- - ; {
printf ("%d\t", a+b ); int i=O, k=3;
i+ = func (k);
i+= func (k);
23. int a=5; i+= func (k);
void func (void); printf ("%d\n", i);
int main (void) return O;
}
func( ); int func (int k)
printf ("%d\n", a) ; {

return O; static int m=2;

} m=m+k;

void func (vo id) return m ;

int a=2;
printf ("%d\t" , a);

Replar Live D oub t claarln& SeHlon• I Free Online Teat Serlea I ABK an eapert
ace Affordable Fee I Available IM I 3M I 6M I \ 2M I IBM and 2 4 Month• Subacrlption Packa&ea
online
;p;;@d\0000410~

26. int main (void) 29. int func (into);


{ int main (void)
int i = 9; {
printf ("¾d", func (2));
if ( i = = 9)
printf (" ¾d" , func (5));
{
printf ("¾d" , func (2));
inti = 25;
} return O;
printf ("i=¾d\n", i); }
return O; int func (int n)

} {
static int s=O;
inti;
27. void func (int a, static int b );
for (i=l ; i<=n ; i++)
int main (void)
s+=i;
{
func (1,2); returns ;
func (3 ,4) ; }
return O ;
30 . Rewrite the function func ( ) without using else
}
void func (int a, static int b) and variable x.

{ int func (int a, int b) ;


a++; int fl (int x, int y) ;
b ++· int f2 (int x, int y);
'
printf ("¾d ¾ d\n", a, b); int main (void)

} {
int a, b ;

28. int func (void); printf ("Enter a and b :");


int main (void) scanf ("%d%d", &a, &b );
printf ("¾d", func (a, b));
inti; return O;
for (i= I ; i<=6; i++) }
pri ntf ("¾d'", func( )); int func (int a, int b)
return O; {
int x;
int func (void) if (a==b)
x = fl (a,b);
static int k= I ; e lse
k*= 2; x = f2 (a, b) ;
return k; return x;
}

/Vf ace India' ■ Be ■t Online Coachlne Platform for GATE, ESE , PSU■ , SSC-JE , SSC, Banks, Orou a & PSC E•am•

~ online Enjoy a ■mooth oallne learnlne e:xperlence In vartou■ laneuaee• at your con ~eJtjen ce
•Ri@ihhhheAMi,Nlhij
int fl (int x, int y) Rewrite the following functions from Q32 to Q33
{ using a single return statement.
return x+y ;
} 32. int func (int n)
int t2 (int x, int y) {
{ if (n= =39)
return x - y ; {
} n+=5 ;
return n;
31. Rew rite the function func ( ) without using the }
variable flag. else
#include< math .h> return n;
int func (int n); }
int main (void)
{ 33 . int func (int x, int b)
int n;
printf ("Enter a number :"); if(x= = 5)
scanf ("¾d" , &n); return b+2;
printf ("¾d", func (n)) ; else if (x> 5)
return O; return b+ IO;
} else
int fun c (int n) return b;

int i, flag=O;
for (i=2, i<= sqrt (n); i++) Rewrite the following functions from Q34 to Q3 7
without using else.
{
if (n¾ i= =0)
34. int ispalindrome (int num)
{
flag= l ; {

break; if (num == reverse (num))


return 1;
}
else
}
return O;
return flag ;
}
}
Replar Li•• Doubt clearinc Sea■lona F re e Online Teat S erie• I ASK an e-Xpert
ace Affordable Fee I A•ailable 111 I 311 I 611 I 12 M I 18M and ~4 Montha S u bacription P ac k ages
online
iPPhiihiiiii4111~
35 . int func (int a, int b) 38. What is the functionality of the following piece of
{
pseudo code
a= a - b; int function(int data)
if (a != 2)
{
{
nodetrnp = bead;
a++;
intvar = O;
return a;
While (tmp != null)
}
{
else
if(tmp - > item== data)
{
a= a+ b; {
printf ("¾d", a); returnvar;
return b;
} var++;
} tmp = tmp - >next;
}
36. int func (int m, int n) return-9999;
{ }
if (m= =5) Which is false about pseudo code?
return n - 10; (a) Find and delete a given element in the list ifit
else if (m>5)
exists otherwise return -9999
return n + 10;
(b) Find and return the given element in the list
else
otherwise return -9999
return n;
(c) Find and return the position ofthe given element
}
in the list otherwise return -9999
37. char findGrade (int ml, int m2, int m3, int m4) (d) Find and insert a new element in the list
{
float total, per; Pointers:
total = m 1+m2+m3+m4;
per= total/4; 39. What is the output printed by the following
if (per>=85) program?
return 'A'; #include <stdio.h>
else if (per>=70) int f(int n, int k)
return 'B ' ; {
else if (per>=55) if(n = = 0)
return 'C' ; return 0;
else if (per>=40) else if (n % 2=1)
return ' D'; return f(n/2, 2 • k) + k;
else else
return 'E';
return f(n/2, 2 • k) - k;
}

ace India'• BHt Online Coachln1 Platform for OATII:, BBJE, P8Ue, 88C-JB, SSC, Banke, Groupe a. PSC Exam•
online Enjoy a amooth online learn1J11 eaperlence In variou■ lancua&ea at your conTellience
[•EA.C~
_ 33 _ _ _ _ _ __ _ _ __
_ _ _ _ _ _ _ _ _ _ _ _ _L__j_
.PMH@iihNiiiM:!1

int main () 41 . Cons ider the follo wing C program:


{ #include <stdio .h>
printf ("¾d" , f(20, I)); typedef struct {
char *a;
}
c har *b;
(a) 5 (b) 8 (c) 9 (d) 20
}t;
void fl (t s);
40. main() void f2 (t *p);
{ main ()
struct sl
{ s tatic t s = {" A" , " B"};

char *str; printf("¾s %s\n", s.a, s. b);


fl (s);
int i;
printf ("%s %s\n", s.a, s.b);
struct sl *ptr;
f2 (&s);
}; )
I
static struct sl a[ ] = { void fl (t s)
{"Nagpur", I , a+ I } ,
{"Raipur", 2, a+2}, s .a =" U";
{"Kanpur", 3, a}} ; s .b = " V";
printf(" %s %s\n", s.a s.b) ;
struct sl *p = a;
return;
int j;
}
for U = O; j<=2; j++)
void f2 (t *p)
{
II
printf(" \n ¾d", --a(j].i);
printf("¾s", ++a[j].str); p --. a = "V";

} p --. b = " W";


} printf("%s %s\n", p --. a, p--. b);
return;

0, agpur (b) 0, Raipur


(a)
l, Nagpur
1, aipur
2, Kanpur What is the output gene rated by the program ?
2,anpur
(a) AB, UV, VW, VW
(d) None of these (b) AB, UV, AB, VW
(c) 0, Kanpur
1, Nagpur (c) AB , UV, UV, VW
2, Raipur (d) AB, UV, VW, UV

Reiular Lin D o ubt olearla1 8eHloaa I f"rH Onllo• Tu t Serl ~J_ ~ ~ p ut~
Affordable Fee I Anilable lM I 311 I 611 I llM j 1911 an~ ~
--- --
Mouth. 81.Lhacrlptlou Pa.c:lr.aa;.. -
-
•P@hihhOOAMONih~

42. AC program is given below: 44. main()


# include<stdio. h> {
int main() static char *s[] ={
{ " black",
int i, j ; "white",
char a[2] [3] = { "yellow",
{'a', ' b' , ' c'} , "violet"
{' d' , 'e', 'f' }
};
};
char **ptr[] = {s+3, s+2, s+l, s}, ***p;
char b[3) [2];
p = ptr;
char *p = *b;
for (i = O; i < 2; i++) **++p;

{
printf("%s", * - -*++p + 3);

for U = O; j < 3; j++) }


{ (a) ck (b) block
*(p+2*j + i) = a[i] [j]; (C) ite (d) ock
}
} 45 . int main(void)
}
What should be the contents of the array b at the
inta= - 3;
end of the program?
a =- a - a + !a;
(a) ab, c d, e f (b) a d, b e, c f
printf("¾d\n", a);
(c) a c, e b, d f ( d) a e, d c, d f
return O;
}
43 . # include<stdio.h>
main()
{ 46. int main (void)
c har s [ ] ={ 'a' , 'b ' , 'c' , ' \n' , ' c' , '\O'} ·,
char *p, *str, *strl ; int a = 2,b = 1, c, d;
p = &s[3) ; c = a < b;
str = p; d = (a > b) && (c < b);
strl =s; printf ("c = ¾ d, d = ¾ d\n", c, d);
printf("¾ d", + +*p+ ++*strl - 32);
return O;
I
J
(a) 32 (b) 77

(c) 7 5 (d) 65

I -~~ _
,Dc!!el~Q~_
aQ ___L_[n_d_l•_·•_ B
_•_• _
t 0
--=n
~ l:....
ln_• _C_o_•c_h_lD
_'_ P_l_
• t_fo_r_
m_r..:::
or_ O....:A
:....T_E_, -E-B E
_ ,_p_s_u_••_s_s_c ...:-J:....
Eajoy a amooth onllno learnin1 oxpertonco In vartoue tancua1ea at your con•entenca
S...:,:....
ss _ c_,..:
B_•n
_ ...
_·_· -0 -r o_"_P•_ •_ P_B_
C _Es
_ •_m
__•
iMhiillbliiiMHF~
4 7. int main( void)
51. int main (void)

inta = 9, b= 15,c= 16 d= 12 e f· int a = 14,b,c;


' ' ' '
e = ! (a<b :: b<c); a= a%5;
f = (a>b)? a-b: b-a; b = a/3;
printf("e=¾d, f=¾d\n",e,t) ; C= a/5%3;
return O; printf("a = ¾d, b=¾d, c=¾d\n", a,b,c);
return O;

48. int main (void)

52. int main(void)


int a=5;
a=6; int a=15, b=13,c=l6,x,y;
a= a+ 5 * a; x = a - 3%2+c*2/4%2+b/4;
printf("a=¾d\n" ,a); y = a = b+5-b+9/3;
return O; printf("x=¾d, y=¾d\n",x,y);
return O;
}

49. int main (void)


int a=5, b=5; 53. int main (void)
{
printf ("¾d, ¾d\t",++a,b- -);
int x, y, z, k=IO;
printf("¾d, ¾d\t" ,a,b );
k+=(x=5,y=x+2, z=x+y);
printf("¾d, ¾d\t", ++a,b++ );
printf("x=¾d,y=¾d,z=¾d,k=¾d\n" ,x,y,z,k);
printf("¾d, ¾d\n" ,a,b );
return O;
return O;

54. int main(void)


50. int main (void)
{
float b;
int x,y,z;
b = 15/2;
X = 8 ++;
printf("¾f\t" ,b);
y = ++x++;
b = (float) 15/2 + ( 15/2);
z = (x+y)- - ;
printf("¾ f\n " ,b );
_ 01d , y=¾d ' z=¾d\n", x, y);
. fi(" x-1°
pnnt return O;
return O;

Replar Live Doubt clearlnt: BeHlone Free Online Teat Serie ■ I ASK an expe rt
ace Affordable Fee I Anllable lM I 3M I 6M I 12M I 18M and 24 Month ■ Subacrlptlon Packages
online
•PMhibibii!Ail!&·h~
55. int main (void) 59. int main(void)
{
{
int a=9;
int a=5,b=6;
char ch= ' A' ;
printf("¾d\t" ,a=b);
a = a+ch+24;
printf("¾d\t" ,a==b);
printf("¾d,%c\t%d,¾ c\n", ch,ch,a,a);
return O; printf("¾d ¾ d\n", a,b);

} return O;
}
56. int main (void)
{ 60. int main(void)
int a,b,c,d;
{
a=b=c=d=4;
int a=3, b=4, c=3,d=4, x,y;
a*=b+l;
x= (a=5) && (b=7);
c+=d*=3 ;
printf("a=¾d, c=¾d\n" ,a,c); y= (c=5) :: (d=8);
return O; printf("a=¾d, b=¾d, c=¾d, d=¾ d, x=¾d,
} y=¾d\n" ,a,b,c,d,x,y);
x= (a == 6) && (b=9);
57. int main (void)
y = (c = =6) :: (d= lO);
{
printf(''a=%d,b=%d,c=%d,d=%d,x=%d,
int a = 5, b = 10, temp;
y=¾d\n", a, b, c, d, x, y);
temp = a, a = b, b = temp;
printf("a=¾d, b=¾d\n", a,b); return O;
return O; }

}
6 1. int main (void)
{
58. int main (void)
int a = 10;
{
a = a++;
int a = 10, b = 3, max;
a = a++ * a--;
a> b ? max = a : max = b;
printf("¾d\n",a);
printf("¾d\n", max);
printf("¾d\n" ,a++ * a++);
return O; return O;
}

ace India'• BHt Online Coachlnc Platform for GATE, ESE, PSUa, S8C-JE, SSC, Banka, Group• • PSC Saam•

online EnjoJ a amooth onllne Jea.rnlllc experience In • arloua lanpace• at Jow- c on•enience

tEUNibhhMAMONld~
62. int main (void)
65 . int main(void)
{
int a= 2, b=2, x,y;
inti= IO;
X = 4*(++a * 2+3);
i == 50;
y = 4* (b++ * 2+3);
if (i==50)
printf("a=¾ d, b=¾d, x=¾d, y=¾d\n",
printf (" i is fifty\n ");
a, b, x, y);
return O; else
printf (" i is not fifty\n");
return O;
Control Stateme nts: }

What is the output for the following programs:


66. int main(void)
{
63 . int main (void)
int a=20, b=3;
if (a< I O)
int a=9;
a = a - 5;
if (a=5)
printf ("a is fi ve\t"); b = b + 5;

else printf ("¾d ¾ d\n",a,b);


printf("a is not fi ve\t"); return O;
printf (" value of a is ¾ d\n", a); }
return O;
67. int main(void)
{
64. int main (void) int i= I, j =9;
{ if (i>=5 && j<5);

int a = O; i=j+2 ;
printf("¾d\n" ,i);
if (a = O)
return O;
printf ("a is zero\t");
}
else
printf ("a is not zero\t");
68. Write this statement using an if-else.
printf (" value of a is ¾ d\n" ,a);
x+= a < b ? (- x) : 100;
return O;

Regular Live Doubt clearln1 Senion■ Free Online Te1t Serie• I ASK an expert
ace Affordable Fee I Available lM I 3M I 6M I l2M I 18M and 24 Month• Sub■criptJon Pacllace■
online
;u@Fhhhhhiih@~

69. Rewrite the follo wing else ... .if chains using z- -;
switch. break;
(i) if(x== l) case 30:
y=x+ l ; switch(y)
else if(x= =2) {
{ case 2:
y=0; z =z+3 ;
x=0; break;
} case 4:
else if (x= =3 :: x= =4 :: x= =5) case 5:
y++;
z = z+l0;
else if (x= =6)
break;
y+=4;
default:
else
z = z-2 ;
y--;
}
(ii) if(x= = I) break;
y=x+ l; default:
else if(x= =2 :: x= =3 :: x= =4) z = 0;
y++;
}
else if (x= =5)
y- - ;
71 . What is the output of the following programs.
else if (x= = 6)
(i) int main (void)
y=0;
int a=5;
. ' ..
{
I ' ' ,
begin:
70. Write equivalent if .. . else statements for the
if(a)
fo ll owing nested switch statements.
{
int x,y; printf ("¾ d\n",a);
x=30, y=5, z; a - -·
'
switch(x) goto begin;
}
case 10: return 0;
z++; }
break;
case 20:

~ ace India' ■ Be ■ t Online Coacbln1 Pla tform for GATE, EBE, PBU■ , SSC-JE, SSC, Ba nk■ , Group ■ & PSC Esaall

I_~ online J!)ajoy a ■mootb onlln• learnln& ezperlen c e In varlou■ lancua1e■ at your c o nve nie nce

t

iPdN@lhhhiiAMhMld~
(ii) int main ( void)
(v) for (i=O; i<=IO; i - -)
{ printf ("¾d", i);
inta=5·,
begin: (vi) for (i=lO; i>= l ; i - - )
if (a) printf ("¾d",i);

printf("%d\ n" , a)·,


(vii) for(i=lO; i>l ; i- -)
a -- .,
printf ("¾d",i);
goto begin;
return O; (viii) for (i=IO; i>O; i - -)
}
printf ("¾d" ,i);

72. How many times will the following while loops


(ix) for (i= l5; i>=O; i= i -3)
iterate.
(a) while (- 1) { printf ("Test Loop\n");} printf ("¾d",i);

(b) while (!O) { printf ("Test Loop\n" );}


(x) for (i= 1O; i>=O; i - - );
(c) while (O){ printf ("Test Loop\n"); }
printf ("¾d",i);
(d) a=O;while (a=O){printf(" Test Loop\n"); }
(e) a=O; while(a=2){p rintf(" Test Loop\n");}
(xi) for (i=O; i> 1O; i ++)
(f) a=O, b= l ; while (a=b)
printf ("%d",i);
{printf (" Test Loop\n") ;}
(g) a= l , b=O; while (a=b)
(xii) for (i=O; i<= 1O; i+=20)
{printf("Test Loop\n);}
prin tf ("¾ d" ,i);

73. How many times will the following for loop


(xiii) fo r (i=l ; i!= lO; i=i+2)
iterate and what values will be printed.
printf ("¾d",i);
(i) for (i=O; i< lO; i++)
printf ("%d",i); (xiv) for (j= lO; i=j; j- =2)
printf ("¾d",i);
(ii) for (i= l ; i<= IO; i++)
printf ("%d",i); (xv) for (i= IO; i - - ;)
printf ("¾d",i);
(i ii) fo r (i=O; i<= IO; i++)
printf ("% d",i); 74. Write for loops for printing these sequenc es.
(i) 10 20 30 40 50 60 70
(iv) fo r (i= l ; i< IO; i++) (ii) - IO - 20 -30 -40 -50 -60 _ 70
printf ("%d" ,i);
Re iuJar Live Doubt clearlnl Se-■lo n• I Free Online Teat Ser-I e■ I ASK an ei pert
ace Affordable Fe e I Available l M I 3 M I 6 M I 1:.IM I 18M and 24 Month■ su b ■c ripUon Packages
online
fPM•MiMiiAMiiA!h~

(iii) l 11 111 1111 11111 78. int main (void)


(iv) 1 2 4 7 11 16 {
(v) 10 7 4 l -2 -5 inti, suml=O,sum2=0;
(vi) l 2 4 8 16 32 for (i=l; i<S; i++)
suml+=i;
75. int main (void) i = l;
{ while (i<S)
int i, j,x=O; {
for (i=O; i<S; i++) i++;
for U=i; j>O; j - -) sum2+=i;
X = i+j+l; }
printf ("x=¾d\n",x); printf ("¾d ¾d\n", suml,sum2) ;
return O;
return O;
}
}

76. int main (void) 79. int main (void)


{ inti, sum;
for (i=O; i< lO; i+=3)
int i,j;
sum+=i*i;
for U=i+ 1,i=1; i<=S; j++ ,i++)
printf ("¾d\n",sum);
printf ("¾d ¾d\n",i,j);
return O;
return O;
}
}

77. int main (void)


80. int main (void)
{ int i=l;
{
for (; ;)
int i=l;
if (i++= =3)
do;
break;
printf ("x=¾d",i); while (++i<IO);
printf ("¾d\n" ,i);
i = I;
while () return O;

if (i + + = = 3) }

break;
printf ("¾d", i); 81 . What is the output of the following for loops.

return O; (i) for (i= I; i<=6 ; i++)


printf ("*");
}

ace lndla'• BHt Online Coachln1 Platform for GATE, EBE, PBU■, BSC-JE, SBC, Bank■ , Group ■ 8t PSC E:u ui•

onllne Enjoy a amooth onllne leamln1 ~•rlence In varlou■ lanl\l-AIH at your convenJe nce
pa

41 iPd@hOO!OhAMOM!d~
(ii) for (j=l; j<=5; j++) break;
for (i=l; i<=6; i++) printf ("%d",i++, j- -);
printf ("*" );
}
printf ("\n"); (iii) for (i=2; i<==sqrt (n); i++)
if(n¾i = =0)
(iii) for (j= 1; j<=5; j++) break;
{
for (i=l ; i<=6; i++) 83. Will the two programs given below give same
printf("*"); output.
printf("\n"); (i) int main (void)
} {
inti = l,j=3 ;
(iv) for (k=l; k<=3; k++) while (i<5)
{ {
for (j=l; j<=5; j++) i++;
{ if G = =O)
for (i= l; i<=6; i++) break;
printf("*"); j - -;
printf("\n"); }

} printf ("¾d ¾ d\n",i,j);

printf("\n"); return O;
}
}

82. Write the following loops without break (ii) int main (void)
{
statement.
int i= l , j=3;
(i) for(i= l;; i++)
while (i<5 && j !=0)
{
if (i> 5) {

break; i++;

printf ("%d",i); j - -;

}
(ii) i= l , j =3; printf ("¾d ¾ d\n" ,ij);

while (i<5) return O;

{ }
if (j= ==0)
Replar LIY• Doubt o learlDI Se■ -lon • J'ree Onllne Teat Serie■ I ASK an ••pert

ace Affordable Fee I AYailabl• 111 I 3M I 611 I l::IM 11811 and ::14 Month■ Subacrlpt!on Packacea

online
i◄hllMiiiiAMIIQ~
84 . Rewrite these for loops so that the initialization, 86. Write these pieces of code using while loops.
test and update expressions are inside the
parenthesis of for statement. (i) i=l, z=O;
do
(i) i= I ; if (i<5)
for ( ; ; ) {
{ printf ("¾d", i++);

if (i= =5) z = z + 2;
break; }
printf('"¾d\n" ,i); }while(i<5);
i++;
} (i i) do
{

(ii)sum=0; printf ("Enter employee ID ( 100- 500):");

for ( ; ; ) scanf ("¾d",& emp_id);

{ } while(emp_ id < 100 :: emp_ id >500);


if(sum> l00)
break; 87. Will these three loops give the same output.
scanf ("¾d", &n); for (i= l ; i<=5; i++)
sum+= n; printf("¾d" ,i);

} i=] ;
wh ile (i<=5)

85 . Write this code using a for loop. {

i=0, j = l 0, k=6; printf ("¾d" ,i);


i++;
wh ile( I)
{
i= l ;
if (i= =j :: k<0)
do
break;
{
printf (" ¾d ¾d ¾ d\n" ,i,j,k);
printf ("¾d", i);
i++;
i++;
J- -; }while (i <=5);
k=k- 2;
}

!Y ace India'• BHt Online Coachln1 Platform for OATlt, lt81t, PSU■ , BIIC-JI!:, SIIC , Danila, Group■ & PBC Ea&lll 1

~ online E,tjoy a ■mooth onlln• leamlnc eaperlence ln Tarloua lan1U•1•• at your c onyenlence
I• ~:£~_. _. ._______________L4:3::_L_ ___________:_•A='=;;='=o=o=n=o=••=•='=.;=-l
= :=J
88 . Wi 11 these three loops g ive the samc output?
(ii) i=0;
ror 0 -- 1; i<a..:5 ; i++)
do
{
i++;
i f( i= =3)
printf("¾d", i);
co n tinue;
while(i<=5);
printf ("%d\ n" , i) '·

90. Write these loops without using continue.


i- 1;
(i) for (i=l; i<6; i++)
whi le (i <=S)
{
if (i= =3)
i f ( i==J)
continue;
co ntinue ;
printf ("%d",i);
pri n tf("¾d\ n" ,i);
i++; }

(ii) x=0, sum=0;


i= I ;
while (x<l 0)
do
{
x++;
if ( i==3)
if (x%2 = =0)
co ntinue;
continue;
printf ("%d\ n",i);
sum+=x;
i + +;
}w hil e (i <=S) ;

89. Co m pare th e output given by these two loops Level-1 Solutions


w h ic h were written to display numbers from I to
Basics:
5, b ut by m ista ke the braces of the loop body are

no t inc luded. 01. Ans: (c)


Sol: Extern storage class in the following declaration,
(i) i= 0 ;
extern int;
w hi le ( i<= S)
Specifies to the compiler that the memory for ' i' is
i++; allocated in some other program. But linker find s
p rin t f ("%d". i); that no other variable of name ' i ' is avail a ble in
any other program with memory space allocated
for it. Hence a linker e rror has o ccurred.
iPMhldildiMMIIA~
02. Ans: (b) 07. Ans: (c)
Sol: Here unary minus (or negation) operator is used Sol: Scanf returns number of items successfully read
twice. Same math rule applies, or not. Here 10 is given as input which should
i.e. minus *minus = plus. have been scanned successfully. So number of
items read is 1.
03. Ans: (a)
Sol: In the expression !i> 14, NOT (!) operator has
more precedence than '>' symbol. ! is a unary 08. Ans: (b)
logical operator. !i (! 10) is O (not of true is false). Sol: Before entering into the for loop the checking
0 > 14 is false (zero) condition is "evaluated". Here it evaluates to
0 (false) and comes out of the loop, and i is
04. Ans: (a) incremented
Sol: \n - newline
\b - backspace
09. Ans: (b)
\r - linefeed
Sol: The rule is that a variable is available for use from
step I : ab
step 2: asi the point of declaration. Even though a is a global

step 3: hai variable, it is not available for main. Hence an


error.
05. Ans: (a)
Sol: The preprocessor directives can be redefined 10. Ans: (a)
anywhere in the program. So the most recently
assigned value will be taken.
11. Ans: (c)

Sol: main function calls itself again and again. Each


06. Ans: (a)
time the function is called its re~m address
Sol: Preprocessor executes as a separate pass before
is stored in the call stack. Since there is no
the execution of the compiler. So textual
replacement of clrscr() to I 00 occurs. The input condition to terminate the function call, the call

program to compiler looks like this: stack overflows at runtime. So it terminates the

main() program and results in an error.

{
100; 12. Ans: (b)
printf("%d\n", I 00); Sol: The input program to the compiler after
processing by the preprocessor is,
Note: I 00; is an executable statement but with no
action . So it doesn't give any problem.

ace India' ■ Be■ t Online Coachln& Platform for GATE, ESE, PSU■ , 88C-JE, SBC, Bank■ , Group■ & PSC EJtasn•

online Eajoy • ■mooth onllne learning experience In varlou■ lansua1•• at :,our con,renience
•PMHIOIMI04Miii9!6~
main ()
16. Ans: (a)
{ Sol: The comma operator has associativity from left
if(O)
to right. Only the rightmost value is returned and
puts("NULL"); the other values are evaluated and ignored. Thus
else if(- 1) the value of last variable y is returned to check in
puts("TRUE"); if. Since it is a non zero value it becomes true so,
else "hello" will be printed.
puts("FALSE");
} 17. Ans:(b)
Preprocessor doesn' t replace the values given Sol: The char array ' a' will hold the initialized string,
inside the double quotes. If condition is Boolean whose length will be counted from O till the
value false so it goes to else. In second if null character. Hence the ' i' will hold the value
' -1' is Boolean value true hence "TRUE" ts equal to 5, after the pre-increment in the printf
printed. statement, the 6 will be printed.

18. Ans: (c)


13 . Ans: (a)
Sol: Due to the assignment p[ l ] = ' c' the string
Sol: When two strings are placed together(or separated
becomes, "%c\n". Since this string becomes the
by white-space) they are concatenated (this is
forma\ string for printf and ASCII value of 65 is
called as "stringiz~tion" operation). So the string
' A', the same gets printed.
is as if it is given as "%d = = 1 is %s". The
conditiopal operator(?:) evaluates to "TRUE". 19. Ans: (b)
Sol: Rule to Remember: & (address of) operator
14. Ans: (a) cannot be applied on register variables.
Sol: If we declare i as register compiler will treat it
as ordinary integer and it will take integer value. 20. Ans: (d)

i value may be stored either in register or in Sol: The identifier 1 1s available in the inner block
and so using extern has no use in resolving it.
memory.
21. Ans: (d)
15. Ans: (a)
Sol: The character array has the memory just enough to
Sol: Let us assume some x= scanf("¾d", &i)-t the
hold the string "HELL" and doesn't have enough
values duri ng execution will be, space to store the terminating null character. So it
t X prints the HELL correctly and continues to print
4 0 -4 garbage values till it accidentally comes across a
3 -2 NULL character.
2 2 0
I Free Online Teat Serlea I ASK an eapert
a ce Re1ular Live Doubt cleutn& Senion•
I I I I 12M I 18M and 24 Montba Subacrlptton PacJu&ea
online Am>rdable ll'H An.l.lable lM 3M 6M

iP@FihhOhAMh@ih~

27. Ans: (c)


Operators: Sol: ! is a logical operator. 1n C the value O is

22. Ans: (a) considered to be the boolea n value FALSE,


Sol: Logical operations always give a result of I or and any non-zero value is considered to be the
0 . And also the logical AND (&&) operator has boolean value TRUE. H ere 2 is a non-zero
higher priority over the logical ORC:) operator. value so TRUE. !TRUE is FALSE (0) so it
So the expression ' i++ && j++ && k++' is
prints 0.
executed first. The result of this expression is
0(- 1 && -1 && 0 = 0). Now the expression is
28. Ans: (a)
0 :: 2 which evaluates to 1 (because OR operator
Sol: '{ ' introduces new block and thus new scope.
always gives 1 except for ' 0 :: 0' combination -
for which it gives 0). So the value of m is 1. The In the innermost block ' i' is declared as,const

values of other variables are also incremented by volatile unsigned which is a valid declaration.
I. 'i' is assumed of type int. So printf prints 30.
In the next block, ' i ' has value 20 and so printf
23. Ans: (c) prints 20. In the outermost block , ' i' is declared
Sol: -1 is internally represented as all l's. When left
as extern, so no storage space is allocated fo r it.
shifted four times the least significant 4 bits are
After compilation is over the linker resolves it to
filled with O's. The %x format specifiers specifies
that the integer value be printed as a hexadecimal global variable 'i ' (since it is the only variable

value. visible there). So it prints i' s value as I 0.

24. Ans: (c) 29. Ans: (d)


Sol: The arguments in a function call are pushed into Sol: i is a constant. we cannot change the value of
the stack from left to right. The evaluation is by
constant
popping out from the stack and the evaluation is
from right to left, hence the result is print.
30. Ans: (b)
Sol: return(i++) it will first return and then
25. Ans: (b)
Sol: enum assigns numbers starting from 0, if not increments. i.e., 9 will be returned .
explicitly defined.
31. Ans: (a)
26. Ans: (b) Sol: The value of i is 0. Since this infomrntion is
Sol: Extern declaration specifies that the variable i is
enough to determine the truth value of the
defined somewhere else. The compiler passes the
boolean expression. So the sta te ment fo llowing
external variable to be resolved by the linker. So
com piler doesn ' t find an error. During linking the the if statement is not executed. T he values of i
linker searches for the definition of i. Since it is and j re main uncha nged and get printed .
not found the linker flags an error.

~ ace India' • BHt Online Coechlnl Platform fo r GAT E , El!IE, PSUa , SSC -JE, S S C, Ba nka, Group s & PSC Exaai•

~ online Eajoy a amooth onllne lea rnln1 expe r ie nce In v a rloua la.npa ce• at yow: c o nvenien c e

iPUM010iMh4iib4161~
32. Ans: (a)
36. Ans: (a)
sol: The variable " i" is declared as stati·c, h ence
Sol: The three usages of name errors can be
memory for 'i' will be allocated tor on 1y once
distinguishable by the compiler at any instance,
as it encounters the statement· Th e funchon . '
so valid (they are in different namespaces).
main() will be called recursively unless
Typedef struct error{int warning, error,
'i' becomes equal to O, and since main() is
exception;}error;
recursively called, so the value of static 'i'
ie., 0 will be printed every time the control is This error can be used only by preceding the error
returned. by struct keyword as in:
struct error someError;
33. Ans: (c) typedef struct error{int warning, error,
exception;} error; This can be used only after
34. Ans: (c) . (dot) or - (arrow) operator preceded by the
Sol: Since static variables are initialized to zero by variable name as in :
default.
gl.error = l ;
printf("o/od" ,g 1.error);
35. Ans: (b)
Sol: The name error is used in the two meanings. One typedef struct error {int warning, error,
means that it is a enumerator constant with value exception;}error;
1. The another use is that it is a type name ( due This can be used to define variables without using
to typedef) for enum errorType. Given a situation the preceding struct keyword as in:
the compiler cannot distinguish the meaning of error gl ;
error to know in what sense the error is used:
Since the compiler can perfectly distinguish
error gl; between these three usages, it is perfectly legal
g l =error; and valid.
// which error it refers in each case? Note: This code is given here to j ust explain the
concept. In real programming don't use such
When the compiler can diSt inguish between
overloading of names. It reduces the readab ility
usages then it will not issue error (in pure
of the code. Possible doesn' t mean that we should
ly be overloaded in
technical terms, names can on use it!
different namespaces).
. th declaration, enum 37. Ans: (a)
Note: The extra comma ID e
. ception,} is not an Sol: The expression can be treated as i = ( ++i= 6),
error Type {wammg, error, ex .
. 11·d and is provided because == is of higher precedence than =
error. An extra comma is va
, onvenience. operator. In the inner expression, ++i is equal to
Just for programmer s c
6 yielding true( l ).
Reaular Ll•e Doubt clearln& Se■-lon■ Free Online Teat Serie■ I ASK an expert
I A•allabl• UI I 3JI I 6M I l:IM I 18M and 2 4 Month■ Sub■crlptlon Package■
ace Affordable Fee

online
lk@Ahhhlhiih&!h~

38. Ans: (b) Functions:


Sol: The Ternary operator (? : ) is equivalent for
if-then-else statement. So the question can be 41. Ans: (a)
written as: Sol: The macro call square(4) will substituted by 4•4
if(ij) so the expression becomes i = 64/4*4. Since /
{ and • bas equal priority the expression will be
if(ij) evaluated as (64/4)*4 i.e. 16*4 = 64
j = i;
else 42. Ans: (c)
j = j; Sol: Labels have function scope, in other words the
}
scope of the labels is limited to functions. The
else
label 'here' is available in function fun() hence it
j = j;
is not visible in function main.

39. Ans: (c)


43. Ans: (a)
Sol: The boolean expression needs to be evaluated
Sol: It is the concept of string concatenation, m
only till the truth value of the expression is not
Printf("¾d" , varl2); which will gives 100
known. j is not equal to zero itself means that
the expression's truth value is l. Because it
44. Ans: (b)
is followed by :: and true :: (anything) ⇒ true
Sol: When the compiler sees the function show it
where (anything) will not be evaluated. So the
doesn't know anything about it. So the default
remaining expression is not evaluated and so the
return type (ie, int) is assumed. But when
value of i remains the same.
compiler sees the actual defi~ition of show
Similarly when && operator is involved in an
mismatch occurs since it is declared as void.
expression, when any of the operands become
Hence the error.
false, the whole expression's truth value becomes
The solutions are as follows
false and hence the remaining expression will not
1. declare void show() in main()
be evaluated.
2. define show() before main().
False && (anything) => false where (anything)
3. declare extern void show() before the use of
will not be evaluated.
show().

40. Ans: (b)


45. Ans: (d)
Sol: Compiler Error: Undefined structure date
Inside the struct definition of' student' the member Sol: ptr is array of pointers to functions of return
of type struct date is given. The compiler doesn' t type int ptr[0] is assigned to address of the
have the definition of date structure (forward function aaa. Similarly ptr[ I] and ptr[2] for bbb
reference is not allowed in C in this case) so it and ccc respectively. ptr[2]() is in effect of
issues an error. writing ccc(), since ptr[2] points to ccc.

ace lndla'a But Online Coaohlnl Platform for OATE • ESE • PSU ■, SSC -JE, SSC, Banke , Groupe • PSC Eaaaa•

online Ito.Joy a ■mooth onUne learnlo1 eaperlence to varloua l■ncu•&•• at your con•entence
iQl@dh,hhhMMl,§mj

46. Ans: (a) a character array and so the space fo r it is


Sol: The base address is modified only in function and allocated in heap and is initialized with character
as a result a points to 'b ' then after incrementing string "string". This is created dynamically
to 'c' so be will be printed. as the function is called, so it is also deleted
dynamically on exiting the function so the string
47. Ans: (c) data is not available in the calling function
Sol: The int ret(int ret), i.e., the function name and main() leading to print some garbage values. The
the argument name can be the same. Firstly, the function someFun2() also suffers from the same
function ret() is called in which the sizeof(float) problem but the problem can be easily identified
ie. , 4 is passed, after the first expression the in this case.
value in ret will be 6, as ret is integer hence
the value stored in ret will have implicit type 52.
conversion from float to int. The ret is returned Ans: 1, l
in main() it is printed after pre-increment. 1, 10, 3
l, 2
48. Ans: (b) 2, 9, 5
Sol: The macro expands and evaluates to as : l, 3
x+2*y- 1 ⇒ x+(2*y)- 1 ⇒ 10 3, 8, 7
Sol: step 1: Global variable 'i' bas value l
49. Ans: (b) step 2: After reset( ) call, main function variable
Sol: The size of integer array of 10 elements is 'i' becomes l.
10 * sizeof(int). The macro expands to sizeof(arr)/ step 3: print(i, j) - l, l
sizeof(int) ⇒ 10 * sizeof(int) / sizeof(int)⇒ 10. step 4: print(next(l )) ⇒l and global 'i' becomes
2
50. Ans: (b) step 5: printf(last(l)) ⇒ 10 and last() have value
Sol: Arrays cannot be passed to function as arguments of i = 9
and only the pointers can be passed. So the step 6: printf(new ( l + l )):3 and value of 'j' m
argument is equivalent to int * array (this is new( ) becomes 2
one of the very few places where [] and * usage step 7: print(i, j) - l, 2
are equivalent). The return statement becomes,
step 8: print(next( l)) - 2 and global value 'i'
sizeof(i nt *)/ sizeof(int) that happens to be equal
becomes '3'.
in this case.
step 9: printf(last( I)) - 9 and local variable of
last( ) is having 'i' value 8.
51. Ans: (d)
step10:print(new(3)) = 5 and 'j' becomes 3
Sol: Both the functions suffer from the problem of
continue above process.
danglin g pointers. In someFun I() temp 1s
Re1ular Live Doubt clearln& 8eHlon ■ Free Online Te■ t Berle ■ I ABK an eapert
ace Affordable Fee I Available lM I 3M I 6M I llM I UM and l4 Month■ Sub■crlptlon Pack.a&ea
online
iFMFIMIYG~
53. Ans: (d)
Pointers:
Sol:
f( 173)

l~
56. Ans: (a)
31
Sol: pis a pointer to a "constant integer' '. But we tried
Pf(173 %2)
f(86) to change the value of the "constant integer".

l~
f(43)
Pf(86%2)
0
57. Ans: (c)
Sol: s[i], *(i+s), *(s+i), i[s] are all different ways of

l~
f(21)
Pf(43%2)
expressing the same idea. Generally array name
is the base address for that array. Here s is the
base address. i is the index number/displacement

I~
f(l0)
Pf(21%2)
1
from the base address. So, indirecting it with •
is same as s[i]. i[s] may be surprising. But in the
case of C it is same as s[i].

I~
f(5)
Pf(10%2)
0
58. Ans: (a)
Sol: The sizeof() operator gives the number of bytes

I~
f(2)
Pf(5%2)
taken by its operand. p is a character pointer,
which needs one byte for storing its value (a
character). Hence sizeof(*p) gives a value of I.

I~
f( l)
Pf(2%2)
0
Since it needs two bytes to store the address of
the character pointer sizeof(p) gives 2.

59. Ans: (c)


lJ
pf(l) - 1
Sol: In third line, when the function display is
encountered, the compiler doesn't know
anything about the function display. It assumes
Output: l O l O l I O I
the arguments and return types to be integers,
(which is the default type). When it sees the
54. Ans: (a)
actual function display, the arguments and type
contradicts with what it has assumed previously.
55. Ans: (d)
Hence a compile time error occurs.

60. Ans: (b)


Sol: You should not initialize variables in declaration.
QCe lndl•'• IIHt Online Coaohln1 Platform for OATlt, 1:81£, P8U■, 88C-JI:, 88C, Bank■, Groupe • P8C 1:a&ma
• ___ onllne_~_____&~~o~,_•_•_m_o_ot_h_o_~_ ._1_m_ ru
_ o1~ ~
~-• r_1._o_c •_ l_o_~_ o_u_• _n ~~~ • ~
P •_• ~
t ,~o_u_r c_o_o_" _~_._o_c •_ _ __
51 iPMAlhhhiiilhMldl~
61. A ns : (d) 65. Ans: (c)
Sol: Array names are pointer constants. So it cannot Sol: Let us consider the array and the two pointers
be modified. with some address
a
62. Ans: (c) 0 2 3 4
Sol: Initialization should not be done for structure 100 102 104 106 108
p
members inside the structure declaration. ~I-10-0 ~1-10-2~1-10-4~1-I-06~11-0-8 I
1000 I 002 1004 I 006 1008
63. Ans: (a) ptr

Sol: The given array is a 3-D one. It can also be viewed ~


2000
as a 1-D array.
After execution of the instruction ptr++ value in
ptr becomes I 002, if scaling factor for integer is
2 4 1 8 3 4 2 2 2 3 3 4
1 1 1 1 1 1 1 1 1 1 1 1 2 bytes. Now ptr - p is value in ptr - starting
100 102 104 106 108 110 11 2 114 116 118 120 122
location of array p, (1002 - 1000) I (scaling factor)
= 1, *ptr - a= value at address pointed by ptr -
starting value of array a, 1002 has a value 102 so
Thus, for the first printf statement a, *a, **a give
the value is (102 - 100)/(scaling factor)= 1, **ptr
address of first element. Since the indirection
is the value stored in the location pointed by the
***a gives the value. Hence, the first line of the
pointer of ptr = value pointed by I 002 = value
output. pointed by 102 = 1. Hence the output of the first
For the second printf a+ 1 increases thus points printf is 1 1 1.
to value at 112, *a+ 1 increments the second After execution of *ptr++ increments value of the
dimension thus points to 104, **a + 1 increments ptr by scaling factor, so it becomes 1004. Hence,
the fi rst dimension thus points to 102 and ***a+ 1 the outputs for the second printf are ptr- p = 2.
*ptr- a =2,**ptr = 2.
firs t gets the value at first location and then
increments it by 1. After execution of *++ptr increments value of
the ptr by scaling factor, so it becomes l 004.
Hence, the outputs for the third printf are ptr - p = 3,
64. Ans: (c)
*ptr - a = 3, **ptr = 3.
Sol: Error is in line with statement a++. The operand
must be an !value and may be of any of scalar After execution of ++*ptr value in ptr remains
type fo r the any operator, array name only when the same, the value pointed by the value 1s
subscripted is an lvalue. Simply array name is a incremented by the scaling fac tor. So the value
in array p at location 1006 changes from I 06
no n-modifi able !value.
to 108. Hence, the outputs for the fou rth printf are
ptr- p = 1006-1000 =3, *ptr - a = 108 - 100 = 4
• •ptr = 4.
.
Replar Lt•• Doubt clearln1 leHlon• I f'r•• Onlln• THt llerlH I ASK an • • pert
ace Affordable f'H I A,railable 111 I 3M I 611 11:111 I 1811 and :14 Month• Subacription J>ackasea
online

52 ,u&YhihhHOPIIIM!h~

66. Ans: (a) 72. Ans: (b)


Sol: Since a void pointer is used it can be type casted to Sol: Void pointer is a generic pointer type. No pointer
any other type pointer. vp = &ch stores address of arithmetic can be done on it. Void pointers are
char ch and the next statement prints the value normally used for,
stored in vp after typecasting it to the proper data I. Passing generic pointers to functions and
type pointer. The output is ' g ' . Similarly the returning such pointers.
output from second printf is ' 20 ' . The third printf 2. As a intermediate pointer type.
statement typecasts it to print the string from the 3. Used when the exact pointer type will be
4 th value hence the output is ' fy '. known at a later point of time.

67. Ans: (a) 73. Ans: (d)


Sol: *a and -*a cancels out. The result is as simple as
Sol: In first sizeof, strl is a character pointer so
it gives the size of the pointer variable. In 1+3 = 4.
second sizeof the name str2 indicates the name
74. Ans: (b)
of the array whose size is 5 (including the '\0 '
Sol: This is due to the close relation between the arrays
termination character). The third sizeof is similar
and pointers. N dimensional arrays are made up
to the second one. of (N - 1) dimensional arrays.arr2D is made up of
a 3 single arrays that contains 3 integers each .
68. Ans: (a)
Sol: The variable ' i' is a block level variable and arr2D arr2D[l]
the visibility is inside that block only. But the
arr2D[2]
lifetime of ' i' is lifetime of the function so
arr2D[3]
it lives upto the exit of main function . Since
the ' i' is still allocated space, *j prints the value The name arr2D refers to the beginning of all the
stored in 'i ' sincej points to ' i'. 3 arrays. *arr2D refers to the start of the first 1D
array (of 3 integers) that is the same address as
69. Ans: (b) arr2D. So the expression (arr2D = = *arr2D) is
true(!).
70. Ans: (d) Similarly, *arr2D is nothing but *(arr2D + 0),
Sol: ptr pointer is pointing to out of the array range of adding a zero doesn't change the value/meaning.
one d. Again arr2D[0] is the another way of telling
*(arr2D + 0). So the expression (*(arr2D + 0) =
71. Ans: (b)
Sol: The pointer points to % since it is incremented
= arr2D[0]) is true ( l ).
twice and again decremented by 2, it points to Since both parts of the expression evaluates to

'¾d\n' and 300 is printed. true the result is true( 1) and the same is printed.
a. P8C
~ ace lndla'• Beet Online Coachln& Platform (or OATJI:, 11:8£, P8U■ , 88C-JJI:, 88C, Dank■ , Group ■ 11:•am ■

~ online Enjoy • emooth onUne learnln1 e11pertence lo Yarlou ■ lansu•1•• at your convenience
53 IPM§iiiOO@NMi@W~
75. Ans: (d) When sizeof operator is applied to an array
Sol: it returns the sizeof the array and it is not the
'y' same as the sizeof the pointer variable. Here the
'q' 'm' '\O'
sizeof(a), where a is the character array and the
00 101 102 103 104
size of the array is 5 because the space necessary
for the terminating NULL character should also

we cannot change the string constant so compile be taken into account.

time error.
80. Ans: (a)
Sol: The integer value 257 is stored in the memory
76. Ans: (c)
as, 10000000 I .
Sol:
I 00000001, so the individual bytes are taken by
'y' 'q' ' m' ' \O' casting it to char * and get printed.
00 101 102 103 104

81. Ans: (c)


Sol: The integer value 300 in binary notation 1s:
0000000 I 00101100. It is stored in memory
c = ++*P; means 'c' has 'b' so output is 'b' (small-endian) as: 00 l O1100 00000001 . Result
of the expression *++ptr = 2 makes the memory
77. Ans: (a) representation as: 00101100 00000010. So, the
Sol: The memory space allocated by malloc is integer corresponding to it is 000000 IO 00 IO 1100
⇒ 556.
uninith\!ized, whereas calloc returns the allocated
memory space initialized to zeros.
82. Ans: (a)
_Sol: After ' ptr' reaches the end of the string the value
78. Ans: (a)
pointed by 'str' is ' \O' . So the value of 'str' is
Sol: fl and f2 both refer to the same memory location
less than that of 'least' . So the value of 'least'
a. So changes through fl and f2 ultimately affects
finally is o .
only the value of a.
83.

79. Sol: (char*(*q)( )) (*ptr[N])( );


Sol : sizeof(p) = 2, sizeof(*p) = 1, strlen(p) =4 84. Ans: (a)
sizeof(a) = 5, strlen(a) = 4
Sol: If the body of the loop never executes p is
sizeof(p) ⇒ sizeof(char*) ⇒ 2 assigned no address. So p remains NULL where
sizeof(*p) ⇒ sizeof(char) ⇒ I *p =O may result in problem (may rise to runtime
Similarly, error "NULL pointer assignment" and terminate
sizeof(a) ⇒ size of the character array ⇒ 5 the program).
Reiular Live Doubt clearln& SeHlon■ I Free Online Te■ t serl •• I A SK an expert
ace Affordable Fee I Available lM I 3M I 6M I l2M I 18M and 24 Month • s u b ■crlptlon Packaae■
onllne
ACE 54 Programming Languages

85. Ans: (a) int k = *ip/ *ip;


Sol: *b is a pointer to type struct a and so is legal. Il give space explicitly separating / and*
The compiler knows, the size of the pointer to a l/or

structure even before the size of the structure is int k = *ip/(*ip);


put braces to force the intention will solve the
determined (as you know the pointer to any type
problem.
is of same size).
This type of structure is known as 'self
91. Ans: (a)
referencing' structure. Sol: The pointer ptr will point at the integer in the
memory location Ox400.
86. Ans: (b)
Sol: The typename aType is not known at the point 92. Ans: (c)
of declaring the structure (forward references are Sol: Void pointers are generic pointers and they
not made for typedefs). can be used only when the type is not known
and as an intermediate address storage type.

87. Ans: (a) No pointer arithmetic can be done on it and you


Sol: The typename aType is known at the point cannot apply indirection operator (*) on void
pointers.
of declaring the structure, because it is already
typedefined.
93. Ans: (d)
Sol: The program suffers no problem and gives the
88. Ans: (b) output correctly because the character constants
aType; is
Sol: When the declaration, typedef struct a are stored in code/data area and not allocated in
This
encountered body of struct a is not known. stack, so this doesn't lead to dangling pointers.
is known as »incomplete types'.
94.
Sol: Address = 655 14 element=24
89.
Address = 65516 element=34
Sol: sizeof (void *) =2
Address =65518 element=12
sizeof (int ) = 2
Address =65520 element=44
sizeof (double *) 2 Address = 65522 element=56
sizeof(struct unknown *) =2
Address = 65524 element=17
size.
The pointer to any type is of same
95.
90. Ans: (c) Sol: element=24
integers,
Sol: The programmer intended to divide two element=34
compiler
but by the "maximal munch" rule, the element=12
treats the operator sequence / and * as /* which element=44
happens to be the starting of comment. To force element=56
what is intended by the programmer, element=17

ace India's Best Online Coaching Platform for GATE, E8E, PBUs, S8C-JE, 88c, Banks, Groups & PSC Exams
aler e emooth online learning experlence in various languages at your convenience
online
jiiiLP

55 •A@§@hiiiihi!IMib§i@~
96.
102.
~ol: address of 0 th 1-D array=65506
Sol: 0 I 2 3 4
address of ph 1-D array=655 l O
address of 2 th 1-D array=65514 103.
address of 3 th 1-D array=65518 Sol: 4 3 2 I 0
address of 4 th 1-D array=65522
104.
97.
Sol: 170, 0
Sol: 1234 56
180, 170, 0
1212 33
180,170, 0
1434 80
1312 78
105. Ans: 1, l, 1
1203 75 2,2,2
3, 3, 3
98. Ans: 65502 65502 3, 4, 4
65504 65510 Sol:
Sol: a
0 2 3 4
a Is 7 5 91 4 6 3 1 2 0 9 61 I
100 102 104 106 108
D 65502 4 6 8 10 12 14 16 18 20 22 24

q l6Jo2 I 102 104 106 108


202 204 206 208
99. Ans: (b)
Sol: 1 2 3 4
0
1 2 3 4 step 1: ptr++ will update ptr conte nt with 202
70 172 174 176 178
202- 200 _
step 2: ptr - P = 2 - I

172 174 176 178 step 3: * ptr - a = 102 -2 100 = I


182 184 186 188 step 4: **ptr ⇒ I
So output for first printf I , I, continue thi s
procedure.

100. 106.
Ans: 10 20 30 40 50 Sol: 4 7
4 7
101. I 4 7
Sot: 0 1 2 3 4
e ular Live Doubt clearln& 8e■■lon■ Free Onlln ■ Te ■t Berle ■ I ABK an eape rt
ace R I Available lM I 3M I 6M I l~M I lBM and ~4 Montha 8ub■crtptlon Packace■
Affordable Fee I
online
•Ed@hi!Ohh!NIOK!i~

Control Statemen ts: 112. Ans:(a)


Sol: The inner printf executes first to print some

107. Ans: (b) garbage value. The printf returns number of


characters printed and this value also cannot be
Sol: For floating point numbers (float, double, long
predicted. Still the outer printf prints something
double) the values cannot be predicted exactly.
and so returns a non-zero value.
Depending on the number of bytes, the precision
So it encounters the break statement and comes
with the value represented varies. Float takes 4
out of the while statement.
bytes and long double takes 10 bytes. So float
stores 0.9 with less precision than long double.
Rule of Thumb: 113. Ans:(c)
Sol: 10 9 8 7 6 5 4 3 2 1 0 65535 65534 .. ...
Never compare or at-least be cautious when using
Since i is an unsigned integer it can never become
floating point numbers with relational operators
(= = ,> ' < ' < = ' >= ' .'=) negative. So the expression i--> = 0 will always
be true, leading to an infinite loop

108. Ans: (b)


Sol: Initially pointer C is assigned to both p and q. 114. Ans: (a)

In the first loop, since only 'q' is incremented Sol: The value of y%2 is 0. This value is assigned

and not 'c' , the value 2 will be printed 5 times. to x . The condition reduces to if(x) or in other

In second loop 'p' itself is incremented. So the words if(0) and so z goes uninitialized.

values 2 3 4 6 5 will be printed. Thumb Rule: Check all control paths to write
bug free code.

109. Ans: (b)


115. Ans: (a)
Sol: The default case can be placed anywhere inside
the loop. It is executed only when all other cases Sol: Note the semicolon after the while statement.

doesn 't match. When the value of i becomes O it comes out of


while loop. Due to post-increme nt on i the value
of i will print I.
110. Ans: (a)
Sol: An ordinary program to check leap year or not.
116. Ans: (c)

Sol: Unary + is the only dummy operator in C. So

111. A ns: (a) it has no effect on the expression and now the
Sol: Printf will return how many characters it prints. while loop is, while(i--!=0) which is false and so
Hence printing a null character returns I which breaks out of while loop. The value - I is printed
makes the if statement true, thus "Ok here" is due to the post-decreme nt operator.
printed.

~ ace 1nd la'• Be■t Online Co ■ohlnc Platform for OATlt, EBlt, PBU•, BBC-Jlt, SBC, Ba nk•, Group• & PSC Exam•

~ online Enjoy • •moolb onllne learntnc experience In v arlou• lan au aae • a t your oon;enle noe
57
ikd@Fhhhii!MiiiM!d~

117. Ans: (a) 122. Ans: (d)


Sol: Notice the semicolon at the end of the for loop. Sol: Switch statements can be applied only to integral
The initial value of the i is set to 0. The inner types.
loop executes to increment the value from o to
127 (the positive range of char) and then it rotates 123. Ans: (d)
to the negative value of -128. The condition in Sol: The else part in which the printf is there becomes
the for loop fails and so comes out of the for the else for if in the assert macro. Hence nothing
loop. It prints the current value of i that is -128. is printed.
The solution is to use conditional operator instead

118. Ans: (a) of if statement, #define assert(cond) ((cond)?(O):

Sol: The difference between the previous question (fprintf (stderr, "assertion failed: \ %s, file %s,

and this one is that the char is declared to be line %d \n",#cond, FILE , LINE), abort()))

unsigned. So the i++ can never yield negative Note: However this problem of "matching with

value and i>=0 never becomes false so that it nearest else" cannot be solved by the usual

cannot come out of the for loop. method of placing the if statement inside a
block like this, #define assert(cond) { \ if(!(cond))
\ (fprintf(stderr, "assertion failed: %s, file %s,
119. Ans: (d)
Sol: Ending the string constant with \0 explicitly line %d \n",#cond,\ FILE_,_ LINE_), abort())\

makes no difference. So "some" and "some\0" }

are equivalent. So, strcmp returns 0 (false) hence


Parameter Passing Techniques:
breaking out of the while loop.

124. Ans: (a)


120. Ans: (c)
Sol: As we know that increment operators return
125. Ans: (d)
rvalues and hence it cannot appear on the left
hand side of an assignment operator. 126. Ans: (b)

121. Ans: (a)


Sol: Since i is static it is initialized to 0. Inside
the while loop the conditional operator evaluates
to false, executing i- -. This continues till the
32767 ).
integer value rotates to positive value (
The while condition becomes false a nd hence,
comes out of the while loop, printing th e i value.
Replar Ll•e Doubt olearln& Se ■alon■ Free Online Te■t Serie■ I ASK an eapert
ace Affordable Fee I Available 111 I 3 M I 6 11 I 1:lM 11811 and :l4 Month■ Sub■orlption Paoka&e■
online

I 58 I iPHl§hiiiiiiii144iiN~

03.
Level 2- Solutions
Sol: Function is declared as void, so the function call
can't used in assignment expression.
Functions:
04.
01. Ans: (a) Sol: If no value is returned through return statement
'
Sol:x =5 , y=10 and the function is not declared of type void then

when count = l garbage value is returned so the variable x will

y = y + funcf (x) + funcg(x) have garbage value.

= 10 + fun cf( 5) + fun cg( 5)


fun cf( 5) ----+ 05.
y = funcg(5) Sol: In variable declarations we can declare many

funcg(5)----+ static y = 10 variables of same type by writing the type name

y=y+l=ll only once, but not in parameter declarations

return( I 1 + 5 )
⇒ y= 16 06.
funcf(5) return 16 Sol: Since function declaration is absent and the

fun cg( 5) ----+ definition is present after the call, there is no


y = y + I = 12 (since y is static) information about the parameters and hence no

return( 12 + 5) parameter checking. The function is called with


y = 10 + 16 + 17 = 43 wrong number of parameters and so the behaviour

when count = 2 is undefined


y = y + funcf(x) + funcg(x)
07.
= 43 + funcf(5) + funcg(5)
Sol: 18 60 27 54
funcf(5) ----+ calls funcg(5)
! 08.
y = y + 1 = 13 ( y is static) Sol: Error: redefinition of formal parameter 'x'
return( 13 +5 )
funcg(5)----+ y = y + I = 14 09.

return( 14 + 5) Sol: Error: Expression syntax, the operands of


y= 43+18+ 19 =80 conditional operator should be expressions, but
return x and return y are not expression. The
02. statement should be written like this.
Sol: We can 't use goto between functions, so this return a<b ? a: b;
program will show an error stating that ab is an
undefined label 10. Ans: 8

h !Y ace lndla'1 But Online Coachlnc Platform for OATJt, IJBI!:, PBU1, BBC-JIJ, BBC, Bank,, Group, a, PSC balD1

~ online Enjoy a 1mooth onllne learntnc experience In vartou, lancua&H at your connn.lenca

~
159 I iilMZiliii,ii!4¥U~
11. 23. Ans: 2 5
Sol: fu nc ( ) is vo id, so it can ' t be used as an operand Sol: In func( ), the local variable will be accessed
of ' + ' operator. because whenever there is a conflict between the
local and global variables the local variable gets
12. Ans: 24 11 the priority.

24. Ans: 10
13. Ans : 22

25. Ans: 24
14. Ans: x = I , y = 2, z = 15 result = 36 Sol: main ()
k
[Q] m
15. Ans: Sum is 3 Pf(i)-+ 24
Sol: If the value of non void function is not to be used, L= j_+ func(3)
5 0 5 m L= j_+ func(3)
then this can be made explicit by converting the Ci] 24 I 3 II
function call expression to void with the help of
L= j_+ func(3)
a cast. 13 5 8

16. Ans: 4 .000000 6.250000 26. Ans: i =9


4.000000 6.250000
27.
Sol: Static keyword is not allowed m param eter
17. declarations.
Sol: We will get errors because a function definition
can't be written inside definition of another 28. Ans: 2 4 8 16 32 64

function. Sol:
i= 1
k func( )
18. Ans: 15 290
~ 112
19. Ans: 2 2 i=2
func()

20. Ans: 7
2b 11=i 3
4

21. Ans: 4 func()


So l: Here expression a, b, c is considered as an
expression with comma operator, and so its value
~118 i=4
is the val ue of r ig htmost operand which is c.
l
Continue
22. Ans: 1 this process

Re1ular Live Doubt clearln1 8e■alona Free Online Teat Serle a I ASK an expe rt
ace Affordable Fee I Available lM I 3M I 611 I 1:2MI 1811 and :24 Month■ S ubacrlption Packages
online
iPMIIOOOOMMh@ih~

29. Ans: 3 18 21 33.


Sol: int funcl (int x, int b)

30. {
if (x= = 5)
Sol: int funcl(int a, int b) b+=2;
{ else if (x>5)
if(a==b) b+ = 10;

return fl(a, b); return b;


}
return f2 (a, b);
} 34.
(OR) Sol: int isPalindromel (int num)
{
int func2 (int a, int b)
if (num = = reverse (num))
{ return I ;
return a== b? fl (a, b): f2(a, b); return O;
}

35.
31.
Sol: int funcl (int a, int b)
Sol: int funcl (int n)
{
{ a= a- b;
inti; if (a! = 2)
for (i=2; i<=sqrt (n); i++) {
a++;
if (n¾i= = 0)
return a;
return 1; }
return 0; a=a+b;
} printf("¾d", a);
return b;
}
32.
Sol: int funcl (int n) 36.
Sol: int func 1 (int m, int n)
if (n = = 39) {
n+=5;
if (m = = 5)
return n-10;
return n;
if(m>5)
return n+ I0;
return n;

!Y ace lndla'a Beet Online Coaching Platform for GATE, ESE, PSUa, SSC-JE, SSC, Banka, Oroupa & PSC Eaam•

~ onllne Enjoy a emooth onllne learning experience in vuloue language• at your con~pnience
61
IMFililH'iP!IEH141ii1

37. call f(n/2, 2*k) - k


Sol: Char findGradel(int ml , int m2 , int m3 , int m4) ⇒ f (5 , 4) - 2
{ float total, per; n% 2= I
total = ml +m2+m3+m4; call f(n/2 , 2*k) + k
per = total /4; ⇒ f(2, 8)+ 4
if (per>=85) n =2 , k = 8
return 'A'; f ( 2, 8) ⇒ call f(n/2 , 2*k) - k
if (per>=70) f (1, 16) - 8
return ' B '; f(l, 16) ⇒ call f(O, 32) + 16

if (per>= 55) f(0, 32) ⇒ n = 0 returns 0


return 'C'; f(0, 32) ⇒ 0

if (per>= 40) f( 1, 16) ⇒ 0 + 16 = 16


return ' D ' ; f(2 , 8) = f( 1, 16)- 8 = 16 - 8 = 8

return ' E '; f(5, 4) = f(2, 8) + 4 = 8+ 4 = 12


f(l0, 2) = f(5 , 4) - 2= 12-2= 10
}
f(20, 1) = f( 10, 2 ) - 1 = 10 - l = 9

38. Ans: (a), (b) &(d)


40. Ans: (a)
Sol: In the while loop, we are sequentially accessing the
Sol: When j =0, - - a[0]. i - prints 0 b ecause a [0]. i = 1
nodes.
If operation if(tmp->item = data)// checking the ++ a(0].str - prints agpur
given element in the particular node. Similarly
When the given element is not available the program Whenj = l
will return -9999 - - a(l].i print l
So given code Find and return the position of the
++ a[ l ].str prints aipur
given element in the list otherwise return -9999 So
Whenj =2
option A,B,D are false
- -a[2].i print 2
++a[2].str prints anpur
Pointers:

39. Ans:(c) 41. Ans: (b)

Sol: f(20, 1) -t ? Sol: Static ts = {"A", " B" }


s .a, s.b prints AB
n = 20 , k= I
fl (s) - call by value .
n -:t= 0 , n % 2 -:t= l
Inside fl (s) it prints UV
call f(n/2, 2 *k) - k
In the ma in after fl (s) function call it prin ts AB
⇒ f (10, 2) - I
because function call is call by va lue
n = I0 , k = 2
Inside f2(&s) it prints VW
n -:t= 0, n % 2 ct: I
Replar LI•• Doubt clearln1 SeHlon■ I Free Online Te■t Serie ■ I ASK a n expe rt
ace Atrord■ble Fee I An.liable lM I 3M I 6M I 12MI 18M ■nd 24 Month ■ Sub■crlptlon Packa ges
online
iPMtiiliiliiil4Mii~
42. Ans: (b) 57. Ans:a = I0, b = 5
Sol: b is the transpose of a
58.
43. Ans: (b) Sol: Since the precedence of assignment operator
Sol: Go through ASCII values from 0 - 127 is less than that of conditional operator, the
conditional statement is interpreted as
44. Ans: (a)
(a>b? max= a: max)= b;
Sol: printf prints 4 th character of the I st String "black"
Now this statement reduces to statement I O=b,

45. Ans: 6 which results in an error. So the solution is to

put parenthesis around the third operand as


46. Ans: c = 0, d = l a> b? max = a: (max =b );

47. Ans:e = 0, f=6


59. Ans: 6 6 6

48. Ans: a = 36
60. Ans: a= 5, b = 7, c = 5, d = 4, x = I , y = I
a= 5, b = 7 , c = 5, d = 10, x = 0 , y = I
49. Ans: 6 ,5 6,4 7,4 7,5

61.
50.
Sol: Result of these type of expression is undefined.
Sol: Error, expressions like
8++, ++x++, (x+y) - - are not valid.
62. Ans: a= 3, b = 3, x = 36, y =2
51. Ans: a= 4, b = l, c = 0

52. Ans: x = 17, y = 8 Control Statements:

53. Ans: x = 5, y = 7, z = 12, k = 22 63. Ans: a is five Value of a is 5

Sol: The mistake here is that assignment operator is


54. Ans: 7.00000 14.500000
used for comparing the values instead of equality

55. Ans: 65,A 98,b operator (= =) . The variable a is assigned the

value 5, and the value of test expression a= 5 is


56. Ans: a = 20, c = I 6
5 which is a non - zero value and in C non - zero
Sol: Precedence of+ operator is more than that of +=.
value means true so the if condition becomes
Associativity of compound assignment operators
is from right to left. true.

r"Vf ace Jndla'1 Beet Online Coachlnc Platform for GATE, E8E, P8Ua, 88C-JE, BBC, Banke, Group• a, PBC E:u111•
~ online Enjoy a 1mooth onllne leamlnc experience In varlou1 lancuac•• at your con,tenlence
i&FiiiiiHN+ieiimj

64. Ans: a is not zero Value of a is O 69.


Sol: As in El , here also assignment operator is used Sol: (i) switch (x)
instead of equality operator. The variable a is {
assigned the value 0, value of test expression case 1:
y=x+ l ;
a = 0 is 0, and in C zero means false, so the if
break;
condition becomes false.
case 2:
y=0;
65. Ans: i is not fifty
x=0;
Sol: The mistake here is that equality operator is used break;
instead of assignment operator for assigning the
case 3 :
value to i. So i is compared with 50 and the result case 4:
of the expression is O which is discarded. The case 5:
variable i remains unassigned. y++;
break;
66. Ans: 20 8 case 6 :
Sol: Only the statement a = a - 5 is part of the if y+=4 ;
statement, the statement b = b + 5 will always break;
be executed. If we want the statement b = b + 5 default :
y--;
to become part of if statement then we need to
enclose both statements w ithin braces. }
(ii) switch (x)
if(a< I0)
{
{
a= a - 5; case 1:
b = b + 5; y=x+l ;
break;
case 2 :
67. Ans: 11 case 3:
Sol: There is a semicolon after the condition of if case 4 :
statement and it is considered as a null statement. y++;
'
if (i>= 5 && j <5) break;
case 5:

i = j + 2; y- - ;
So the statement i=j +2 will always be executed. break
case 6:
68. y = O;
Sol: if (a< b) }
X = O; In (ii), the last else is not present, so there is no
else
default in the switch.
x+= I00;
Re1ular Liv• Doubt olurtn1 leu lona I Free On llne Te■t lerle ■ I ASK an eapert
Affordable Fee I A•allable UI I 3M I 611 112M I 1111 lllld 24 Mon th• Subacrtptlon Packqea
iANiliiiiliilii#Q.g
70.
(f) Variabl e a is assigne d value of b which is
1
Sol: if (x= = t O)
and so the value of expres sion a= b is I, thus
z++; the loop will iterate infinite ly.
else if (x = = 20)
(g) Variabl e a is assigne d value of b which is o,
z--·,
and so the value of express ion a= b is 0, thus
else if (x = = 30)
the loop will not iterate even once.
{
if (y = = 2) 73.
z = z + 3; Sol: (i) 0 l 2 3456789
else if (y = =4 ::y = = 5)
(ii) 1234 5678 910
z=z+ 10;
(iii) 0 l 2 3 4 5 6 7 8 9 10
else
(iv) l 2 3 4 5 6 7 8 9
z = z - 2;
(v) This loop will run infinite ly. Value of i is
}
else initially O and it is decrem ented in each

z= O; loop iteratio n, so i will never exceed 10 and


hence the conditi on i < = 10 never becomes
71. false.
Sol:(i) 5 4 3 2 l (vi) 10 9 8 7 6 5 4 3 2 l
(ii) This program runs infinitely, becaus e the goto (vii) 10 9 8 7 6 5 4 3 2
stateme nt is not inside the if structur e. (viii) l O 9 8 7 6 5 4 3 2 l
(ix) 15129 630
72. (x) -1
Sol: (a) -1 is a non zero value so the loop conditi on There 1s a semico lon after the closing
is always true, hence the loop will iterate parenth esis of for stateme nt, this acts as a
infinite ly. null stateme nt.
(b) Loop will iterate infinite ly. for (i=lO; i>=O; i- - )
(c) Loop conditi on is false, so the loop will not
iterate even once.
printf ("¾d", i);
( d) Variabl e a is assigne d value zero in loop
The loop iterates 11 times and when the
conditi on a=O, the value of this express ion is
value of i become s - 1, control comes out of
O so the conditi on is false, and the loop will
the loop and value of i is printed .
not iterate even once.
(xi) Loop conditi on is initially false so the loop
(e) Variabl e a is assigne d value 2 in loop
does not iterate even once.
conditi on a = 2, the value of this express ion
(xii) 0
is 2 so the conditi on is true, and the loop will
iterate infinite ly. This loop will iterate once and after that the
conditi on wi ll become false
ace India'• Be•t Onlln• Coachln& Platform for OATlt, ESE, PBU■ , 88C-JE,
SSC, Bank■, Group• • PSC E:ir.am•
onllne lt~oy • ■mooth online leamlnc up•rlenc e lo •arlou■ lancuage ■ at
:,our con••nla nce
•PMh!Ohhi!YMl!MihN~
(x iii) l35791 1 13 15 ......... 78. Ans: 10 14
This loop wi ll iterate infi nitely as the value
of i will never become lo.
79.
(xiv) 10 8 6 4 2
Sol: The comma operator is evaluated from left to
The loop terminates when the value o f right, so first j = l + 1 is evaluated and then i= I .
assignment expression (i = j) becomes zero The correct way is to write first i = 1 and then
(xv) 9 8 7 6 5 4 3 2 1 O j = i+ I.
The loop terminates when the value of
expression i- - becom es zero 80. Ans: 10
Sol: There is a null statement in do-while loop.
74. do
Sol: (i) fo r (term = 10; term< = 70; term+=l O)
prin tf ("%d", term); while (+ + i< 10);
(ii) for (term= - 10; term>= - 70;term - = 10)
printf ("%d", term); 81.
(iii) for(term= 1; term<= l 1111 ; tenn=term* 10+ 1) Sol: (i) w ill print 6 stars in one line.
printf (" % d", tenn); (ii) will print 5 groups of 6 stars in one line i.e.

(iv) i = O; 30 stars will be printed in one line.


for(term= l ;term<= l 6; i++,term=term+i) (iii) will print 5 groups of 6 stars, each group on

printf ("%d", term); a separate line.


(v) for (term= lO; term>= - 5; term-= 2) (iv) Whatever is printed in part (iii) will be

printf ("%d", term) ; printed 3 times.

(vi) for (term= l ; term<=32; term*=2)


printf (" %d" , term); 82.
Sol: i. for (i= l ; i<=S; i++)
printf ("%d", i);
75. Ans: x =6
ii. i=l,j= 3;
76. while(i<S && j !=0)
Sol: The variable sum is not initialized to zero if it is printf ("%d", i++, j - - );
initia lized to zero then the result will be 126.
iii. for(i=2; i<=sqrt(n) && no/oi!=O;i++)

77. 83. Ans: (i) 5 0 (ii) 4 0


Sol: The first for loop is an infinite loop, and the break
Sol: In program (i), there is a statement before break
statement will terminate it. The printf will print
in the loop. So we can't remove this break by
4 . In whi le loop, we cannot omit the condition
negating its condition and putting in the loop
as in fo r loop. So there is a syntax error in the
condition.
second loop.
Recu lar LI•• Doubt c leartnc 8aulon• I Free Online Teat Serie• I ASK an eap•rt
ace Affordable Fee I Anilable l M I 3M I 6M I 1211 11811 and ~4 llontb a Subacrtption Pacbcea
online
;PD@hihihhiA&.;;;;~
84. 88.
Sol: (i) for (i = l ; i! = 5; i++) Sol: The output given by first loop is : l 2 4 5

printf("¾d\n'', i); The other two loops will iterate infinitely after
printing I and 2. In for loop, the continue
statement transfers the control to the update
(ii) for (sum=0; sum<= 100; sum+=n)
expression, in while and do - while loops the
scanf(" ¾d", &n);
control is transferred to the test expression. In the
while and do-while loops given in the exercise
85.
the expression that changes the value of i is after
Sol: for (i=0, j=I0, k=6; i!=j && k>=0; i++,j- -,
continue statement. Once the continue statement
k=k-2)
is encountered, test expression is checked and
printf("%d%d%d\n", i, j, k);
again continue is executed and this process goes
on infinitely
86.
Sol: (i) Here the loop condition is checked inside the
89.
loop before executing the body of loop, so this Sol: (i) 6
can be written using while loop as. (ii) syntax error
i= l, z= 0;
while (i<5) 90.
Sol: (i) for (i=l ; i<6; i++)
printf (" ¾d", i++); { if (i!=3)
z=z+2; printf ("¾ d", i);
} }

(ii) printf("Enter employee ID (100-500):"); (ii) x= 0, sum=0;

scanf ("¾d", &emp_id); while (x< I0)

while (emp_id< l00 :: emp_ id> 500) { x++;


if(x%2 ! = 0)
sum+=x;
printf(" Enter employee ID (100-500):");
scanf("¾d", &emp_id);

(Note: All programs are executed under turbo C 3.0


compiler)
87.
Sol: 1 2 3 4 5
All the loops will give the same output.

ace Iud la'• 8 ••t Online Coachla& Platform for GATE, ESE, PSU•, SSC-JE, SSC, Bank■ , Group• a, PSC Eiam■
onllne 11:ajoy a ■mooth oaline leanu.aI •Ipe rt ■nee I n variou■ laD,uaae■ at your convenience

You might also like