0% found this document useful (0 votes)
72 views5 pages

Venkat

1. The address of element N(6) in a 2D array with the first element at address 1000 and each element occupying 3 bytes would be 1000 + 6 * 3 = 1018. 2. If the first and second, third and fourth, fifth and sixth words of the word "OPQRSIERTIOSR" are interchanged, the tenth letter from the right would be "S". 3. Finding the largest prime number that can be stored in an 8-bit memory, the prime number 127 is the largest that can be represented using 8 bits.

Uploaded by

Mohan Ram
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views5 pages

Venkat

1. The address of element N(6) in a 2D array with the first element at address 1000 and each element occupying 3 bytes would be 1000 + 6 * 3 = 1018. 2. If the first and second, third and fourth, fifth and sixth words of the word "OPQRSIERTIOSR" are interchanged, the tenth letter from the right would be "S". 3. Finding the largest prime number that can be stored in an 8-bit memory, the prime number 127 is the largest that can be represented using 8 bits.

Uploaded by

Mohan Ram
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

C-Aptitude -11(DBZ)

1. Is this valid? struct a { struct b *next;}; struct b { struct a *next;}; a)yes b)error b'coz structure b is used before declaration c)error bcoz both struct a b use a !ointer "ith the sa#e na#e d)both b c $. for"ard references are 1) not allo"ed in structure%union%enu#eration ta& na#es $) allo"ed in structure%union%enu#eration ta& na#es ') allo"ed in function calls( "here the na#e of the function is undeclared )) allo"ed in labels after &oto state#ents "here that label is declared later a)1 only b)1( ' ) c)$( ' ) d)) only '."hat is the out!ut? *include+stdio.h, #ain-) { struct x { char a . 1; }x1; int x; x1.a/0; !rintf-12d3(x1.a); } ). 4rror is due to line 1 int a / 10; $ int b / b 5 a; ' int #ain-) ) {int local / &lobal;} 6 int &lobal / 10; 7 void fun-) 8 {int local / &lobal;} a)$ b)) c)no error d)6 6. "hat is the out!ut? int #ain-) {

int* i(9; int a/6(b/7; i/ a; 9/ b; *i55; *955; !rintf-:2d..2d:(*i(*9); } a)&arba&e values b)7..8 c)error d)co#!iler de!endent 7. "hich of the declarations are%is correct? 1)const volatile int unsi&ned static a; $)int const static volatile unsi&ned a; ')unsi&ned const static volatile int a; ))volatile const int unsi&ned static a; a)1 only b)$ only c)' only d)) only e)all the ) 8. "hat is the out!ut? int foo-); int #ain-) { int i/foo-); } int foo-) { int * i;tr; { int i / 10; i;tr / i; } { int < / $0; } !rintf-:2d:( *i;tr); } a)10 b)$0 c)10 or $0 d)error =. "hat is the out!ut? *include+stdio.h, *include+conio.h, int foo-int); int #ain-) { struct na#e {int na#e ;} na#e; int du##y/10; int na#; na#e . na#/foo-du##y);

} int foo-int foo) { foo. !rintf-:2d:(foo); } a)&arba&e value b)error c)10 d)co#!iler de!endent >. 4rror is due to line 1 int #ain-) ${ ' extern static int I; ) ty!edef static int b; 6} a)no error b)' ) c)' only d)) only 10. "hat is the out!ut? struct te#!{ int i; const int 9; }; int #ain-) { struct te#! te#!1; te#!1.i/10; te#!1.9/$0; !rintf-:2d..2d:(te#!1.i(te#!1.9); } a)10..$0 b)?value re@uired c)const cannot be #odified d)co#!iler de!endent 11. "hat is the out!ut? int #ain-) { int i(9; i/sizeof-'$878); 9/sizeof-'$87=); </sizeof--int)'$87=); !rintf-:2d..2d..2d:(i(9(<); } a)$..$..$ b)$..)..$ c))..$..$ d) error. can't store lon& in int 1$. "hat is the out!ut? int #ain-) {

int i / 0; i / A B C sizeof-i) ; !rintf-:2d:( i); } a)$ b)error c)C1 d)0 1'. "hat is the out!ut? #ain-) { int *!(*@; !/#alloc-$); *!/66; free-!); @/#alloc-$); !rintf-:2dD:(*!); !rintf-:2d:(*@); &etch-); } 1). "hat is the out!ut? *define EIF4 6 void s"a!-int *i( int *9) { *i / *i 5 *9;*9 / *i C *9;*i / *i C *9; } int #ain-) { int i; int arrGEIF4H / { 1($('()(6}; for-i/0; i+EIF4; i55) s"a!- arrGiH( arrGEIF4CiC1H); for-i/0; i+EIF4; i55) !rintf-:2d :(arrGiH); } a)6 ) ' $ 1 b)1 $ ' ) 6 c)1 $ 0 ) 6 d)6 ) 0 $1 16. "hat is the out!ut? #ain-) { char *s/-char*)#alloc-6); s/3Iello Jorld3; !rintf-s); } 17. "hat is the out!ut? int #ain-) {int b/-10($0); int a/-'0(60); a/a++)5b; !rintf-:2d..2d:(a(b);}

a)error b)=$0..$0 c)0..$0 d)=0..$0 18. "hat is the out!ut? *include+stdio.h, *define ;?KE 5 int #ain-) { int i / 10; ;?KE5i; !rintf-:2d:( ;?KE5i); &etch-); } 1=. "hat is the out!ut? int #ain-) { si&ned char ch/6; "hile-ch/chCC) !rintf-:2d:(ch); } a)6 ) ' $ 1 b)) ' $ 1 0 c)error d)infinite loo! 1>. "hat is the out!ut? int #ain-) { enu# bool{true( false} boolLar( *bool;tr; bool;tr/ boolLar; *bool;tr/true; !rintf-:2d:(*bool;tr); } a)1 b)0 c)error d)&arba&e value $0. "hat is the out!ut? int #ain-) { union u { int a; char b; }u1; u1.a/$00; !rintf-12d3(u1.a); } $1. Mase class has so#e virtual #ethod and derived class has a #ethod "ith the sa#e na#e. If "e initialize the base class !ointer "ith derived
object,. calling of that virtual method

will result in which method being called? a. Base method b. Derived method.. 22. char *foo() { char result !""#)$ strc%&(result,'an&thing is good')$ return(result)$ ( void main() { char *j$ j)foo() %rintf('*s',j)$ ( 2+.,ind the out%ut for the following - %rogram main() { int .)/$ %rintf('*d *d *d0n',.,.112,.222)$ ( 23. ,456 *f%!,*f%2$ f%!)fo%en('one','w') f%2)fo%en('one','w') f%utc(787,f%!) f%utc(7B7,f%2) fclose(f%!) fclose(f%2) ( ,ind the 6rror, 4f 8n&? 2/. void main() { char *s #){ 'dharma','hewlett9 %ac:ard','siemens','ibm'($ char **%$ %)s$ %rintf('*s',;;*%)$ %rintf('*s',*%;;)$ %rintf('*s',;;*%)$ (

QUANTITATIVE AND LOGICAL REASONING (Aptitude -9) 1. In a t"oCdi#ensional array( N ->( 8)( "ith each ele#ent occu!yin& ) bytes of #e#ory( "ith the address of the first ele#ent N -1( 1) is '000; find the address of N -=( 6). $. In the "ord OPQRSIERTIOSR?( if the first and second( third and forth( forth and fifth( fifth and sixth "ords are interchan&ed u! to the last letter( "hat "ould be the tenth letter fro# ri&ht? '. Jhat is the lar&est !ri#e nu#ber that can be stored in an =Cbit #e#ory? ). Eelect the odd one outD..a. Uava b. ?is! c. E#alltal< d. Eiffel. 6. Eelect the odd one out a. EVT; b. JR; c. SAP d. ARP 7. Eelect the odd one out a. Oracle b.
Linux c. Ingress d. DB2

days and in ho" #any days child can do the sa#e "or<? 1$.In "hich of the syste#( deci#al nu#ber 1=) is e@ual to 1$')? 1'. R !o"er unit is there by the ban< of the river of 860 #eters "idth. R cable is #ade fro# !o"er unit to !o"er !lant o!!osite to that of the river and 1600#ts a"ay fro# the !o"er unit.The cost of the cable belo" "ater is Ps.16%C !er #eter and cost of cable on the ban< is Ps.1$%C!er #eter. Zind the total of layin& the cable. 1). Zind the value of the 78= to the baseC 8. 16. Su#ber of faces( vertices and ed&es of a cube 17. [o#!lete the series $( 8( $)( 88(\\ 18. Zind the value of ]]5$6C55]17( "here ] denotes :s@uare: and 5 denotes :s@uare root:. 1=. Zind the result of the follo"in& ex!ression if( V denotes #odulus o!eration( P denotes roundCoff( T denotes truncation. V-'8'(6)5P-'.))5T-8.8)5P-6.=) 1>. If TRZUII is coded as PM4^QI then PMXU^ can be coded as? $0. Q-0)/ C1( Q-1)/1( Q-S)/Q-SC1) C Q-SC$)( Q-6)/ ? $1. Jhat is the #ax !ossible ' di&it !ri#e nu#ber? $$. In Vadras( te#!erature at noon varies accordin& to Ct_$%$ 5 =t 5 '(

8. Eelect the odd one out a. JR; b. ITT; c. BAAN d. ARP =. Eelect the odd one out a. ?ISKN b. KSIN c. EO?RPIE d. SQL SEVER >. Eelect the odd one out a. EW? b. XM$ c. EYMRE4 d. HTTP 10. The size of a !ro&ra# is S. Rnd the #e#ory occu!ied by the !ro&ra# is &iven by V / s@uare root of 100S. If the size of the !ro&ra# is increased by 12 then ho" #uch #e#ory no" occu!ied? 11. R #an( a "o#an( and a child can do a !iece of "or< in 7 days. Van only can do it in $) days. Jo#an can do it in 17

"here t is ela!sed ti#e. Zind ho" #uch te#!erature #ore or less in )!# to >!#.

You might also like