Professional Documents
Culture Documents
Share 26
C language tricky good pointers questions answers and explanation operators data types arrays structures questions fun recursion preprocessors, looping, file handling, strings questions switch case if else printf advance c linux objective types faq interview questions and answers with explanation and solution for freshers or beginners. Placement online written tes numbers Armstrong Fibonacci series factorial palindrome code programs examples on c c++ tutorials and pdf
C tutorial C Programming Questions C Interview Questions C Programs C Test C programming pdf Program of c++ Create projects
C program examples C interview questions and answers Data type questions Variable naming rule questions Operators questions Control flow questions Switch case questions Looping questions Pointer questions String questions Printf,Scanf questions Preprocessor questions Structure questions Commad line argument C questions in Linux C online test C mixed practice sets C tricky questions Example of recursion in c C programming forums
Ci n t e r v i e wq u e s t i o n sa n da n s w e r sf o rf r e s h e r s .I ti sb a s i l a n g u a g et e c h n i c a lf r e q u e n t l ya s k e di n t e r v i e wq u e s t i o n sa n a n s w e r s .I ti n c l u d e sd a t as t r u c t u r e s ,p o i n t e r si n t e r v i e w q u e s t i o n sa n da n s w e r sf o re x p e r i e n c e d
I n t e r v i e wq u e s t i o n sa n da n s w e ro fCw i t he x p l a n a t i o nf o rf r e s h e r
W r i t eacp r o g r a mt op r i n tH e l l ow o r l dw i t h o u tu s i n ga n ys e m i c o l o n .
E x p l a n a t i o n :
S o l u t i o n :1 v o i dm a i n ( ) { i f ( p r i n t f ( " H e l l ow o r l d " ) ) { } } S o l u t i o n :2 v o i dm a i n ( ) { w h i l e ( ! p r i n t f ( " H e l l ow o r l d " ) ) {
1/35
C TUTORIAL
Memory mapping tutorial in c Variables tutorial in c Data types tutorial in c Storage classes tutorial in c Looping tutorial in c Pointers tutorial in c
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
9/24/13
Function tutorial in c Array tutorial in c Preprocessor tutorial in c Advanced c tutorial
} } S o l u t i o n :3 v o i dm a i n ( ) { s w i t c h ( p r i n t f ( " H e l l ow o r l d " ) ) { } } H i d e
POPULAR POSTS
SWAP TWO VARIABLES WITHOUT USING THIRD USING C PROGRAM VARIABLE C program examples Check given number is prime number or not using c program C interview questions and answers Program to convert decimal to binary in c Write a c program to reverse a string TO FIND FIBONACCI SERIES USING C PROGRAM QUICK SORT USING C PROGRAM Find out the perfect number using c program Merge sort program in c
2 S w a pt w ov a r i a b l e sw i t h o u tu s i n gt h i r dv a r i a b l e .
E x p l a n a t i o n :
# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n ta = 5 , b = 1 0 ; / / p r o c e s so n e a = b + a ; b = a b ; a = a b ; p r i n t f ( " a =% d b = % d " , a , b ) ; / / p r o c e s st w o a = 5 ; b = 1 0 ; a = a + b ( b = a ) ; p r i n t f ( " \ n a =% d b = % d " , a , b ) ; / / p r o c e s st h r e e a = 5 ; b = 1 0 ; a = a ^ b ; b = a ^ b ; a = b ^ a ; p r i n t f ( " \ n a =% d b = % d " , a , b ) ; / / p r o c e s sf o u r a = 5 ; b = 1 0 ; a = b ~ a 1 ; b = a + ~ b + 1 ; a = a + ~ b + 1 ; p r i n t f ( " \ n a =% d b = % d " , a , b ) ; / / p r o c e s sf i v e a = 5 , b = 1 0 ; a = b + a , b = a b , a = a b ; p r i n t f ( " \ n a =% d b = % d " , a , b ) ; r e t u r n0 ; } H i d e
Subscribe
Delivered by FeedBurner
C questions and answers Debugging questions in c with answers Aptitude questions and answers in c C basic questions Multiple choice questions in c
STANDARD OF QUESTIONS ? Excellent Good Avg Worst Vote Show results
MY HEADLINES
C programming questions and answer C questions and answers Debugging questions in c with answers Aptitude questions and answers in c C basic questions Multiple choice questions in c Objective questions of c Program in c language Simple program example in c
3 W h a ti sd a n g l i n gp o i n t e ri nc ?
2/35
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
9/24/13
language Tricky c questions and answers C programming online test C Linux interview questions and answers Looping questions in c and answers C string questions and answers with explanation C operator questions with answers Check the given number is palindrome number or not using c program C pointers questions Data type questions in c Check given number is prime number or not using c program struct bit fields questions in c C questions answers C interview questions and answers How to test palindrome in c++ Palindrome number in c++ Program of palindrome number in c++ C++ code to get sum of all odd numbers in given range
E x p l a n a t i o n :
D a n g l i n gp o i n t e r :
I f a n y p o i n t e ri s p o i n t i n g t h e m e m o r y a d d r e s s o fa n y v a r i a b l e a f t e r s o m e v a r i a b l e h a s d e l e t e d f r o m t h a t m e l o c a t i o nw h i l ep o i n t e ri ss t i l lp o i n t i n gs u c hm e m o r yl o c a t i o n . p o i n t e r i s k n o w na s d a n g l i n g p o i n t e r a n d t h i s p r o b l e mi s k n o w n d a n g l i n gp o i n t e rp r o b l e m . I n i t i a l l y :
L a t e r :
C LOVER COMMUNITY
F o re x a m p l e : W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ?
Already a member? Sign in
# i n c l u d e < s t d i o . h >
ABOUT ME
ritesh kumar
Follow
1.4k
GOOGLE+ BADGE
Add to circles
O u t p u t :G a r b a g ev a l u e N o t e :I ns o m ec o m p i l e ry o um a yg e tw a r n i n gm e s s a g er e t u r n i n ga d d r e o fl o c a lv a r i a b l eo rt e m p o r a r y
E x p l a n a t i o n :v a r i a b l exi sl o c a lv a r i a b l e .I t ss c o p ea n dl i f e t i m e w i t h i nt h ef u n c t i o nc a l lh e n c ea f t e rr e t u r n i n ga d d r e s so fxv a r i a b xb e c a m ed e a da n dp o i n t e ri ss t i l lp o i n t i n gp t ri ss t i l lp o i n t i n g
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 3/35
9/24/13
t h a tl o c a t i o n .
4 W h a ti sw i l dp o i n t e ri nc ?
E x p l a n a t i o n :
A p o i n t e r i n c w h i c h h a s n o t b e e n i n i t i a l i z e d i s k n o w n a s p o i n t e r . E x a m p l e : W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ? i n tm a i n ( ) { i n t* p t r ; p r i n t f ( " % u \ n " , p t r ) ; p r i n t f ( " % d " , * p t r ) ; r e t u r n0 ; } O u t p u t :A n ya d d r e s s G a r b a g ev a l u e
H e r ep t ri sw i l dp o i n t e rb e c a u s ei th a sn o tb e e ni n i t i a l i z e d . i sd i f f e r e n c eb e t w e e nt h eN U L Lp o i n t e ra n dw i l dp o i n t e r .N u l lp o i p o i n t st h eb a s ea d d r e s so fs e g m e n tw h i l ew i l dp o i n t e rd o e s n tp a n ys p e c i f i cm e m o r yl o c a t i o n . H i d e
5 W h a ta r em e r i t sa n dd e m e r i t so fa r r a yi nc ?
E x p l a n a t i o n :
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 4/35
9/24/13
M e r i t s : ( a )W ec a ne a s i l ya c c e s se a c he l e m e n to fa r r a y . ( b )N o tn e c e s s i t yt od e c l a r et o om a n yv a r i a b l e s . ( c )A r r a ye l e m e n t sa r es t o r e di nc o n t i n u o u sm e m o r yl o c a t i o n . D e m e r i t :
( a )W a s t a g eo fm e m o r ys p a c e .W ec a n n o tc h a n g es i z eo fa r r a ya t r u nt i m e . ( b )I tc a ns t o r eo n l ys i m i l a rt y p eo fd a t a . H i d e
6 D oy o uk n o wm e m o r yr e p r e s e n t a t i o no fi n ta=7?
E x p l a n a t i o n :
M e m o r yr e p r e s e n t a t i o no f : s i g n e di n ta = 7 ; ( I nT u r b occ o m p i l e r ) s i g n e ds h o r ti n ta = 7( B o t ht u r b oca n dL i n u xg c cc o m p i l e r ) B i n a r ye q u i v a l e n to fd a t a7i n1 6b i t : 0 0 0 0 0 0 0 00 0 0 0 0 1 1 1 D a t ab i t :0 0 0 0 0 0 00 0 0 0 0 1 1 1( T a k ef i r s t1 5b i tf o r mr i g h ts i d e ) S i g nb i t :0( T a k el e f t m o s to n eb i t )
F i r s te i g h tb i to fd a t ab i tf r o mr i g h ts i d ei . e .0 0 0 0 0 1 1 1w i l ls i nt h el e f t m o s tb y t ef r o mr i g h tt ol e f ts i d ea n dr e s ts e v e nb i d a t ab i ti . e .0 0 0 0 0 0 0w i l ls t o r ei nr i g h t m o s tb y t ef r o mr i g h tt o s i d ea ss h o w ni nt h ef o l l o w i n gf i g u r e :
7 W h a ti sa n dw h ya r r a yi nc ?
E x p l a n a t i o n :
A n a r r a y i sd e r i v e d d a t a t y p e i n c p r o g r a m m i n gl a n g u a g e w h i c h s t o r es i m i l a rt y p eo fd a t ai nc o n t i n u o u sm e m o r yl o c a t i o n .D a t am a p r i m i t i v e t y p e ( i n t , c h a r , f l o a t , d o u b l e ) , a d d r e s s o f u n s t r u c t u r e ,p o i n t e r ,f u n c t i o no ra n o t h e ra r r a y . E x a m p l eo fa r r a yd e c l a r a t i o n : i n ta r r [ 5 ] ; c h a ra r r [ 5 ] ; f l o a ta r r [ 5 ] ; l o n gd o u b l ea r r [ 5 ] ; c h a r*a r r [ 5 ] ; i n t( a r r [ ] ) ( ) ; d o u b l e* *a r r [ 5 ] ; A r r a yi su s e f u lw h e n :
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 5/35
9/24/13
Q u e s t i o n :W r i t e aC p r o g r a mt of i n do u ta v e r a g eo f2 0 0i n t e g e rn u u s i n gp r o c e s so n ea n dt w o .
( b ) W e w a n t t o s t o r e l a r g e n u m b e r o f d a t a i n c o n t i n u o u s m e l o c a t i o n .A r r a ya l w a y ss t o r e sd a t ai nc o n t i n u o u sm e m o r yl o c a t i o n . W h a tw i l lb eo u t p u tw h e ny o uw i l le x e c u t et h ef o l l o w i n gp r o g r a m ? i n tm a i n ( ) { i n ta r r [ ] = { 0 , 1 0 , 2 0 , 3 0 , 4 0 } ; c h a r* p t r = a r r ; a r r = a r r + 2 ; p r i n t f ( " % d " , * a r r ) ; r e t u r n0 ; } A d v a n t a g eo fu s i n ga r r a y :
1 .A na r r a yp r o v i d e ss i n g en a m e. S oi te a s yt or e m e m b e rt h en a m a l le l e m e n to fa na r r a y . 2 . A r r a y n a m e g i v e s b a s e a d d r e s s o f a n a r r a y . S o w i t h t h e i n c r e m e n t o p e r a t o r w e c a n v i s i t o n e b y o n e a l l t h e e l e m e n t o f a r r a y . 3 .A r r a yh a sm a n ya p p l i c a t i o nd a t as t r u c t u r e .
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 6/35
9/24/13
A r r a yo fp o i n t e r si nc :
8 W h yw eu s ed o w h i l el o o pi nc ?A l s ot e l la n yp r o p e r t i e sw h i c hy o u
E x p l a n a t i o n :
I t i s a l s o c a l l e d a s p o s t t e s t e d l o o p . I t i s u s e d w h e n i t n e c e s s a r yt oe x e c u t et h el o o pa tl e a s to n et i m e .S y n t a x : d o{ L o o pb o d y }w h i l e( E x p r e s s i o n ) ; E x a m p l e : i n tm a i n ( ) { i n tn u m , i = 0 ; d o { p r i n t f ( " T oe n t e rp r e s s1 \ n " ) ; p r i n t f ( " T oe x i tp r e s s 2 " ) ; s c a n f ( " % d " , & n u m ) ; + + i ; s w i t c h ( n u m ) { c a s e1 : p r i n t f ( " Y o ua r ew e l c o m e \ n " ) ; b r e a k ; d e f a u l t:e x i t ( 0 ) ; } } w h i l e ( i < = 1 0 ) ; r e t u r n0 ; } O u t p u t :3344
I f t h e r e i s o n l y o n e s t a t e m e n t i n t h e l o o p b o d y t h e n b r a c e s o p t i o n a l .F o re x a m p l e : ( a ) i n tm a i n ( ) { d o u b l ei = 5 . 5 6 7 8 ; d o p r i n t f ( " h i " ) ; w h i l e ( ! i ) ;
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 7/35
9/24/13
r e t u r n0 ; } O u t p u t :3344 ( b ) i n tm a i n ( ) { d o u b l ei = 5 . 6 3 3 3 3 ; d o p r i n t f ( " h i " ) ; w h i l e ( ! i ) ; r e t u r n0 ; } O u t p u t :h i ( c ) i n tm a i n ( ) { i n tx = 2 5 , y = 1 ; d o i f ( x > 5 ) p r i n t f ( "O N E " ) ; e l s ei f ( x > 1 0 ) p r i n t f ( "T W O " ) ; e l s ei f ( x = = 2 5 ) p r i n t f ( "T H R E E " ) ; e l s e p r i n t f ( "F O U R " ) ; w h i l e ( y ) ; r e t u r n0 ; } O u t p u t :O N EO N E H i d e
9 W h a ti st h em e a n i n go fp r o t o t y p eo faf u n c t i o n ?
E x p l a n a t i o n :
P r o t o t y p eo faf u n c t i o n
D e c l a r a t i o n o f f u n c t i o n i s k n o w n a s p r o t o t y p e o f a f u n c t P r o t o t y p eo faf u n c t i o nm e a n s ( 1 )W h a ti sr e t u r nt y p eo ff u n c t i o n ? ( 2 )W h a tp a r a m e t e r sa r ew ep a s s i n g ? ( 3 )F o re x a m p l ep r o t o t y p eo fp r i n t ff u n c t i o ni s : i n tp r i n t f ( c o n s tc h a r* , ) ;
I . e .i t sr e t u r nt y p ei si n td a t at y p e ,i t sf i r s tp a r a m e t e rc o n s c h a r a c t e r p o i n t e r a n d s e c o n d p a r a m e t e r i s e l l i p s i s i . e . v a r i n u m b e ro fa r g u m e n t s . H i d e
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
8/35
9/24/13
1 0 W r i t eacp r o g r a mt om o d i f yt h ec o n s t a n tv a r i a b l ei nc ?
E x p l a n a t i o n :
1 1 W h a ti sp o i n t e rt oaf u n c t i o n ?
E x p l a n a t i o n :
( 1 )W h a tw i l lb eo u t p u ti fy o uw i l le x e c u t ef o l l o w i n gc o d e ? i n t*f u n c t i o n ( ) ; i n tm a i n ( ) { a u t oi n t* x ; i n t* ( * p t r ) ( ) ; p t r = & f u n c t i o n ; x = ( * p t r ) ( ) ; p r i n t f ( " % d " , * x ) ; } i n t* f u n c t i o n ( ) { s t a t i ci n ta = 1 0 ; r e t u r n& a ; } O u t p u t :1 0 E x p l a n a t i o n :H e r ef u n c t i o ni sf u n c t i o nw h o s ep a r a m e t e ri sv o i d t y p ea n dr e t u r nt y p ei sp o i n t e rt oi n td a t at y p e . x = ( * p t r ) ( ) = >x = ( * & f u n c t y i o n ) ( )/ / p t r = & f u n c t i o n = >x = f u n c t i o n ( )/ / F r o mr u l e* & p = p = >x = & a S o ,* x=* & a=a= 1 0 ( 2 )W h a tw i l lb eo u t p u ti fy o uw i l le x e c u t ef o l l o w i n gc o d e ? i n tf i n d ( c h a r ) ; i n t ( * f u n c t i o n ( ) ) ( c h a r ) ; i n tm a i n ( ) { i n tx ; i n t ( * p t r ) ( c h a r ) ; p t r = f u n c t i o n ( ) ; x = ( * p t r ) ( ' A ' ) ; p r i n t f ( " % d " , x ) ; r e t u r n0 ; } i n tf i n d ( c h a rc ) { r e t u r nc ; } i n t ( * f u n c t i o n ( ) ) ( c h a r ) { r e t u r nf i n d ; } O u t p u t :6 5 E x p l a n a t i o n :H e r ef u n c t i o nw h o s en a m ei sf u n c t i o nw h i c hp a s s i n g d a t at y p ea n dr e t u r n i n ga n o t h e rf u n c t i o nw h o s ep a r a m e t e ri sc h a r t y p ea n dr e t u r nt y p ei si n td a t at y p e .
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 9/35
9/24/13
x = ( * p t r ) ( A ) = >x =( * f u n c t i o n( ) )( A )/ / p t r = f u n c t i o n( ) / / & f i n d = f u n c t i o n( )i . e .r e t u r nt y p eo ff u n c t i o n( ) = >x =( *& f i n d )( A ) = >x =f i n d( A )/ / F r o mr u l e * & p = p = >x =6 5 ( 3 )W h a tw i l lb eo u t p u ti fy o uw i l le x e c u t ef o l l o w i n gc o d e ? c h a r*c a l l ( i n t* , f l o a t* ) ; i n tm a i n ( ) { c h a r* s t r i n g ; i n ta = 2 ; f l o a tb = 2 . 0 l ; c h a r* ( * p t r ) ( i n t * , f l o a t* ) ; p t r = & c a l l ; s t r i n g = ( * p t r ) ( & a , & b ) ; p r i n t f ( " % s " , s t r i n g ) ; r e t u r n0 ; } c h a r* c a l l ( i n t* i , f l o a t* j ) { s t a t i cc h a r* s t r = " c p o i n t e r . b l o g s p o t . c o m " ; s t r = s t r + * i + ( i n t ) ( * j ) ; r e t u r ns t r ; }
O u t p u t :i n t e r . b l o g s p o t . c o m E x p l a n a t i o n :H e r ec a l l i sf u n c t i o nw h o s er e t u r nt y p e i sp o i n t e r c h a r a c t e ra n do n ep a r a m e t e ri sp o i n t e rt oi n td a t at y p ea n ds e p a r a m e t e ri sp o i n t e rt of l o a td a t at y p ea n dp t ri sp o i n t e rt o f u n c t i o n . s t r =s t r + * i +( i n t )( * j ) = c p o i n t e r . b l o g s p o t . c o m +* & a +( i n t )( * & b ) / / i = & a ,j = & b = c p o i n t e r . b l o g s p o t . c o m +a +( i n t )( b ) = c p o i n t e r . b l o g s p o t . c o m + 2+( i n t )( 2 . 0 ) = c p o i n t e r . b l o g s p o t . c o m + 4 = i n t e r . b l o g s p o t . c o m ( 4 )W h a tw i l lb eo u t p u ti fy o uw i l le x e c u t ef o l l o w i n gc o d e ? c h a rf a r*d i s p l a y ( c h a rf a r * ) ; i n tm a i n ( ) { c h a rf a r *s t r i n g = " c q u e s t i o n b a n k . b l o g s p o t . c o m " ; c h a rf a r* ( * p t r ) ( c h a rf a r* ) ; p t r = & d i s p l a y ; s t r i n g = ( * p t r ) ( s t r i n g ) ; p r i n t f ( " % s " , s t r i n g ) ; } c h a rf a r* d i s p l a y ( c h a rf a r*s t r ) { c h a rf a r*t e m p = s t r ; t e m p = t e m p + 1 3 ; * t e m p = ' \ 0 ' ; r e t u r ns t r ; }
O u t p u t :c q u e s t i o n b a k E x p l a n a t i o n :H e r ed i s p l a yi sf u n c t i o nw h o s ep a r a m e t e ri sp o i n t e c h a r a c t e ra n dr e t u r nt y p ei sa l s op o i n t e rt oc h a r a c t e ra n dp t ri s p o i n t e r . t e m pi sc h a rp o i n t e r t e m p = t e m p + 1 3 t e m p = \ 0
A b o v e t w o l i n e s r e p l a c e s f i r s t d o t c h a r a c t e r b y n u l l c h a r a c t e r s t r i n go fv a r i a b l es t r i n gi . e . " c q u e s t i o n b a n k \ 0 b l o g s p o t . c o m " H i d e
A sw ek n o w% sp r i n tt h ec h a r a c t e ro fs t r e a mu pt on u l lc h a r a c t e r .
1 2 W r i t eacp r o g r a mt of i n ds i z eo fs t r u c t u r ew i t h o u tu s i n gs i z e o f o p e r a t o r ?
E x p l a n a t i o n :
s t r u c t A B C {
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 10/35
9/24/13
i n ta ; f l o a tb ; c h a rc ; } ; i n tm a i n ( ) { s t r u c tA B C* p t r = ( s t r u c tA B C* ) 0 ; p t r + + ; p r i n t f ( " S i z eo fs t r u c t u r ei s :% d " , * p t r ) ; r e t u r n0 ; } H i d e
1 3 W h a ti sN U L Lp o i n t e r ?
E x p l a n a t i o n :
L i t e r a l m e a n i n g o fN U L L p o i n t e r i s a p o i n t e r w h i c hi s p o i n t i n g n o t h i n g .N U L Lp o i n t e rp o i n t st h eb a s ea d d r e s so fs e g m e n t . E x a m p l e so fN U L Lp o i n t e r : 1 .i n t* p t r = ( c h a r* ) 0 ; 2 .f l o a t* p t r = ( f l o a t* ) 0 ; 3 .c h a r* p t r = ( c h a r* ) 0 ; 4 .d o u b l e* p t r = ( d o u b l e* ) 0 ; 5 .c h a r* p t r = \ 0 ; 6 .i n t* p t r = N U L L ; W h a ti sm e a n i n go fN U L L ? A n s w e r : N U L L i s m a c r o c o n s t a n t w h i c h h a s b e e n d e f i n e d i n t h e h e a r d s t d i o . h ,a l l o c . h ,m e m . h ,s t d d e f . ha n ds t d l i b . ha s # d e f i n eN U L L0 E x a m p l e s : ( 1 ) W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ? # i n c l u d e" s t d i o . h " i n tm a i n ( ) { i f ( ! N U L L ) p r i n t f ( " Ik n o wp r e p r o c e s s o r " ) ; e l s e p r i n t f ( " Id o n ' tk n o wp r e p r o c e s s o r " ) ; } O u t p u t :Ik n o wp r e p r o c e s s o r E x p l a n a t i o n : ! N U L L=! 0=1 I ni fc o n d i t i o na n yn o nz e r on u m b e rm e a nt r u e . ( 2 ) W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ? # i n c l u d e" s t d i o . h " i n tm a i n ( ) { i n ti ; s t a t i ci n tc o u n t ; f o r ( i = N U L L ; i < = 5 ; ) { c o u n t + + ; i + = 2 ; } p r i n t f ( " % d " , c o u n t ) ; } O u t p u t :3 ( 3 ) W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ? # i n c l u d e" s t d i o . h " i n tm a i n ( ) { # i f n d e fN U L L # d e f i n eN U L L5 # e n d i f
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 11/35
9/24/13
p r i n t f ( " % d " , N U L L + s i z e o f ( N U L L ) ) ;
1 4 W h a ti sd i f f e r e n c eb e t w e e np a s sb yv a l u ea n dp a s sb yr e f e r e n c e ?
E x p l a n a t i o n :
I ncw ec a np a s st h ep a r a m e t e r si naf u n c t i o ni nt w od i f f e r e n tw a y
9/24/13
} O u t p u t :1 05 H i d e
1 5 W h a ti ss i z eo fv o i dp o i n t e r ?
E x p l a n a t i o n :
S i z eo fa n yt y p eo fp o i n t e ri n ci si n d e p e n d e n to fd a t at y p ew h i c p o i n t e ri sp o i n t i n gi . e .s i z eo fa l lt y p eo fp o i n t e r( n e a r )i n t w ob y t ee i t h e ri ti sc h a rp o i n t e r ,d o u b l ep o i n t e r ,f u n c t i o np o i o rn u l lp o i n t e r . V o i dp o i n t e ri sn o te x c e p t i o no ft h i sr u l ea n d o fv o i dp o i n t e ri sa l s ot w ob y t e . H i d e
1 6
W h a ti sd i f f e r e n c eb e t w e e nu n i n i t i a l i z e dp o i n t e ra n dn u l lp o i n t e r ?
E x p l a n a t i o n :
A n u n i n i t i a l i z e d p o i n t e r i s a p o i n t e r w h i c h p o i n t s u n k n o w n m e l o c a t i o nw h i l en u l lp o i n t e ri sp o i n t e rw h i c hp o i n t san u l lv a l u b a s ea d d r e s so fs e g m e n t .F o re x a m p l e : i n t* p ; / / U n i n i t i a l i z e dp o i n t e r i n t* q =( i n t* ) 0 ; / / N u l lp o i n t e r # i n c l u d e < s t d i o . h > i n t* r = N U L L ; / / N u l lp o i n t e r W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ? # i n c l u d e < s t r i n g . h > # i n c l u d e < s t d i o . h > i n tm a i n ( ) { c h a r* p ; / / U n i n i t i a l i z e dp o i n t e r c h a r* q = N U L L ; / / N u l lp o i n t e r ; s t r c p y ( p , " c q u e s t i o n b a n k " ) ; s t r c p y ( q , " c q u e s t i o n b a n k " ) ; p r i n t f ( " % s % s " , p , q ) ; r e t u r n0 ; } O u t p u t :c q u e s t i o n b a n k( n u l l ) H i d e
1 7 C a ny o ur e a dc o m p l e xp o i n t e rd e c l a r a t i o n ?
E x p l a n a t i o n :
R u l e1 . A s s i g n t h ep r i o r i t y t o t h e p o i n t e rd e c l a r a t i o n c o n s i d e p r e c e d e n c ea n da s s o c i a t i v ea c c o r d i n gt of o l l o w i n gt a b l e .
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
13/35
9/24/13
( ) :T h i so p e r a t o rb e h a v e sa sb r a c k e to p e r a t o ro rf u n c t i o no p e r a t o r [ ] :T h i so p e r a t o rb e h a v e sa sa r r a ys u b s c r i p t i o no p e r a t o r .
* :T h i so p e r a t o rb e h a v e sa sp o i n t e ro p e r a t o rn o ta sm u l t i p l i c a t i o n o p e r a t o r .
I d e n t i f i e r :I ti sn o ta no p e r a t o rb u ti ti sn a m eo fp o i n t e rv a r i a b Y o uw i l la l w a y sf i n dt h ef i r s tp r i o r i t yw i l lb ea s s i g n e dt ot h en a o fp o i n t e r . D a t at y p e :I ti sa l s on o ta no p e r a t o r .D a t at y p e sa l s oi n c l u d e s m o d i f i e r( l i k es i g n e di n t ,l o n gd o u b l ee t c . ) Y o uw i l lu n d e r s t a n di tb e t t e rb ye x a m p l e s : ( 1 )H o wt or e a df o l l o w i n gp o i n t e r ? c h a r( *p t r ) [ 3 ]
A n s w e r : S t e p1 :( )a n d[ ]e n j o y se q u a lp r e c e d e n c e .S or u l eo fa s s o c i a t i v e w i l ld e c i d et h ep r i o r i t y .I t sa s s o c i a t i v ei sl e f tt or i g h ts of i r s p r i o r i t yg o e st o( ) .
S t e p2 :I n s i d et h eb r a c k e t*a n dp t re n j o ye q u a lp r e c e d e n c e .F r o m r u l eo fa s s o c i a t i v e( r i g h tt ol e f t )f i r s tp r i o r i t yg o e st op t ra n d s e c o n dp r i o r i t yg o e st o* .
S t e p 3 :A s s i g nt h i r dp r i o r i t yt o[ ] .
S t e p 4 :S i n c ed a t at y p ee n j o y sl e a s tp r i o r i t ys oa s s i g nf o u r t h p r i o r i t yt oc h a r . N o wr e a di tf o l l o w i n gm a n n e r : p t ri sp o i n t e rt os u c ho n ed i m e n s i o n a la r r a yo fs i z et h r e ew h i c h c o n t e n tc h a rt y p ed a t a .
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 14/35
9/24/13
( 2 )H o wt or e a df o l l o w i n gp o i n t e r ? f l o a t( *p t r ) ( i n t ) A n s w e r : A s s i g nt h ep r i o r i t yc o n s i d e r i n gp r e c e d e n c ea n da s s o c i a t i v e .
N o wr e a di tf o l l o w i n gm a n n e r : p t ri sp o i n t e rt os u c hf u n c t i o nw h o s ep a r a m e t e ri si n tt y p ed a t aa r e t u r nt y p ei sf l o a tt y p ed a t a .
R u l e2 :A s s i g nt h ep r i o r i t yo fe a c hf u n c t i o np a r a m e t e rs e p a r a t e l y r e a di ta l s os e p a r a t e l y .U n d e r s t a n di tt h r o u g hf o l l o w i n ge x a m p l e . ( 3 )H o wt or e a df o l l o w i n gp o i n t e r ? v o i d( * p t r ) ( i n t( * ) [ 2 ] , i n t( * )v o i d ) ) A n s w e r :
A s s i g nt h ep r i o r i t yc o n s i d e r i n gr u l eo fp r e c e d e n c ea n da s s o c i a t i v e
N o wr e a di tf o l l o w i n gm a n n e r :
p t ri sp o i n t e rt os u c hf u n c t i o nw h i c hf i r s tp a r a m e t e ri sp o i n t e r o n ed i m e n s i o n a la r r a yo fs i z et w ow h i c hc o n t e n t i n tt y p ed a t aa n d s e c o n dp a r a m e t e ri sp o i n t e rt os u c hf u n c t i o nw h i c hp a r a m e t e ri sv o a n dr e t u r nt y p ei si n td a t at y p ea n dr e t u r nt y p ei sv o i d . ( 4 )H o wt or e a df o l l o w i n gp o i n t e r ? i n t(*(*p t r)[5])()
A n s w e r : A s s i g nt h ep r i o r i t yc o n s i d e r i n gr u l eo fp r e c e d e n c ea n da s s o c i a t i v e
N o wr e a di tf o l l o w i n gm a n n e r :
p t ri sp o i n t e rt os u c ha r r a yo fs i z ef i v ew h i c hc o n t e n t a r ep o i n t e rt os u c hf u n c t i o nw h i c hp a r a m e t e ri sv o i da n dr e t u r nt y i si n tt y p ed a t a . ( 5 )H o wt or e a df o l l o w i n gp o i n t e r ? d o u b l e * ( * ( * p t r ) ( i n t ) ) ( d o u b l e* * , c h a rc )
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 15/35
9/24/13
A n s w e r : A s s i g nt h ep r i o r i t yc o n s i d e r i n gr u l eo fp r e c e d e n c ea n da s s o c i a t i v e
N o wr e a di tf o l l o w i n gm a n n e r :
p t ri sp o i n t e rt of u n c t i o nw h i c hp a r a m e t e ri si n tt y p ed a t aa n d r e t u r nt y p ei sp o i n t e rt of u n c t i o nw h i c hf i r s tp a r a m e t e ri sp o i n t e t op o i n t e ro fd o u b l ed a t at y p ea n ds e c o n dp a r a m e t e ri sc h a rt y p ed t y p ea n dr e t u r nt y p ei s p o i n t e rt od o u b l ed a t at y p e . ( 6 )H o wt or e a df o l l o w i n gp o i n t e r ? u n s i g n e d* * ( * ( * p t r ) [ 8 ] ( c h a rc o n s t* ,. . . )
A n s w e r : A s s i g nt h ep r i o r i t yc o n s i d e r i n gr u l eo fp r e c e d e n c ea n da s s o c i a t i v e
N o wr e a di tf o l l o w i n gm a n n e r :
p t ri sp o i n t e rt oa r r a yo fs i z ee i g h ta n dc o n t e n to fa r r a y i sp o i n t e rt of u n c t i o nw h i c hf i r s tp a r a m e t e ri sp o i n t e rt oc h a r a c t c o n s t a n ta n ds e c o n dp a r a m e t e ri sv a r i a b l en u m b e ro fa r g u m e n t sa n d r e t u r nt y p ei sp o i n t e rt op o i n t e ro fu n s i g n e di n td a t at y p e . H i d e
1 8 W h a ta r et h ep a r a m e t e rp a s s i n gc o n v e n t i o n si nc ?
E x p l a n a t i o n :
1 .p a s c a l :I nt h i ss t y l ef u n c t i o nn a m es h o u l d( n o tn e c e s s a r y) i n u p p e r c a s e. F i r s tp a r a m e t e r o ff u n c t i o nc a l li sp a s s e d t ot h ef p a r a m e t e ro ff u n c t i o nd e f i n i t i o na n ds oo n .
2 .c d e c l :I nt h i ss t y l ef u n c t i o nn a m ec a nb eb o t hi nt h eu p p e r o rl o w e rc a s e .F i r s tp a r a m e t e ro ff u n c t i o nc a l li sp a s s e dt ot h e p a r a m e t e r o f f u n c t i o n d e f i n i t i o n . I t i s d e f a u l t p a r a m e t e r p a s c o n v e n t i o n . E x a m p l e s : 1 .W h a tw i l lb eo u t p u to ff o l l o w i n gp r o g r a m ? i n tm a i n ( ) { s t a t i ci n ta = 2 5 ; v o i dc d e c lc o n v 1 ( ); v o i dp a s c a lc o n v 2 ( ) ; c o n v 1 ( a ) ; c o n v 2 ( a ) ; r e t u r n0 ; ; } v o i dc d e c lc o n v 1 ( i n ta , i n tb ) { p r i n t f ( " % d% d " , a , b ) ; }
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 16/35
9/24/13
v o i dp a s c a lc o n v 2 ( i n ta , i n tb ) { p r i n t f ( " \ n % d% d " , a , b ) ; } O u t p u t :2 50 02 5 ( 2 )W h a tw i l lb eo u t p u to ff o l l o w i n gp r o g r a m ? v o i dc d e c lf u n 1 ( i n t , i n t ) ; v o i dp a s c a lf u n 2 ( i n t , i n t ) ; i n tm a i n ( ) { i n ta = 5 , b = 5 ; f u n 1 ( a , + + a ) ; f u n 2 ( b , + + b ) ; r e t u r n0 ;
9/24/13
c o n v e n t i o n ( a , + + a ) ; r e t u r n0 ;
1 9 W h a ti st h ef a rp o i n t e ri nc ?
E x p l a n a t i o n :
T h ep o i n t e rw h i c hc a np o i n to ra c c e s sw h o l et h er e s i d e n c em e m o r R A Mi . e .w h i c hc a na c c e s sa l l1 6s e g m e n t si sk n o w na sf a rp o i n t e r .
9/24/13
O u t p u t :8 F D 9 : F F F 4( A s s u m e ) N o t e :W ec a n n o tg u e s sw h a tw i l lb eo f f s e ta d d r e s s ;s e g m e n ta d d r e s s a n df a ra d d r e s so fa n yf a rp o i n t e r. T h e s ea d d r e s sa r ed e c i d e db y o p e r a t i n gs y s t e m . L i m i t a t i o no ff a rp o i n t e r :
W ec a n n o tc h a n g eo rm o d i f yt h es e g m e n ta d d r e s so fg i v e nf a ra d d r e s b ya p p l y i n ga n ya r i t h m e t i co p e r a t i o no ni t .T h a ti sb yu s i n g
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 19/35
9/24/13
T h i sp r o p e r t yo ff a rp o i n t e ri sc a l l e dc y c l i cn a t u r eo ff a rp o i n t e w i t h i ns a m es e g m e n t . I m p o r t a n tp o i n t sa b o u tf a rp o i n t e r :
1 .F a rp o i n t e rc o m p a r e sb o t ho f f s e ta d d r e s sa n ds e g m e n ta d d r e s sw i r e l a t i o n a lo p e r a t o r s . E x a m p l e s : ( 1 ) W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ? i n tm a i n ( ) { i n tf a r* p = ( i n t* ) 0 X 7 0 2 3 0 0 0 0 ; i n tf a r* q = ( i n t* ) 0 X B 0 2 1 0 0 0 0 ; i f ( p = = q ) p r i n t f ( " B o t hp o i n t e r sa r ee q u a l " ) ; e l s e p r i n t f ( " B o t hp o i n t e r sa r en o te q u a l " ) ; r e t u r n0 ; } O u t p u t :B o t hp o i n t e r sa r en o te q u a l ( 2 ) W h a tw i l lb eo u t p u to ff o l l o w i n gcp r o g r a m ? i n tm a i n ( ) { i n tf a r* p = ( i n t* ) 0 X 7 0 2 3 0 0 0 0 ; i n tf a r* q = ( i n t* ) 0 X B 0 2 1 0 0 0 0 ; i n tn e a r* x , n e a r * y ; x = ( i n tn e a r* ) p ; y = ( i n tn e a r* ) q ; i f ( x = = y ) p r i n t f ( " B o t hp o i n t e ra r ee q u a l " ) ; e l s e p r i n t f ( " B o t hp o i n t e ra r en o te q u a l " ) ; r e t u r n0 ; } O u t p u t :B o t hp o i n t e r sa r ee q u a l
www.cquestions.com/2010/10/c-interview-questions-and-answers.html 20/35
9/24/13
2 .F a rp o i n t e rd o e s n tn o r m a l i z e . H i d e
2 0
W h a ti sac y c l i cp r o p e r t yo fd a t at y p ei nc ?E x p l a i nw i t ha n ye x a m p
E x p l a n a t i o n :
# i n c l u d e < s t d i o . h > i n tm a i n ( ) { s i g n e dc h a rc 1 = 1 3 0 ; s i g n e dc h a rc 2 = 1 3 0 ; p r i n t f ( " % d % d " , c 1 , c 2 ) ; r e t u r n0 ; }
O u t p u t :1 2 6 1 2 6( w h y ? ) T h i ss i t u a t i o ni sk n o w na so v e r f l o wo fs i g n e dc h a r . R a n g e o f u n s i g n e d c h a r i s 1 2 8 t o1 2 7 . I f w e w i l l a s s i g n a v g r e a t e rt h a n1 2 7t h e nv a l u eo fv a r i a b l ew i l lb ec h a n g e dt o av a l u w ew i l lm o v ec l o c k w i s ed i r e c t i o na ss h o w ni nt h ef i g u r ea c c o r d i n n u m b e r .I fw ew i l la s s i g nan u m b e rw h i c hi sl e s st h a n1 2 8t h e h a v et om o v ei na n t i c l o c k w i s ed i r e c t i o n .
H i d e
P o i n t e r sI n t e r v i e wq u e s t i o n s D a t at y p e sI n t e r v i e wq u e s t i o n s A d v a n c ei n t e r v i e wq u e s t i o n s S t r i n gi n t e r v i e wq u e s t i o n sa n da n s w e r s C o m m o n l ya s k e dq u e s t i o n s T C Sp l a c e m e n tq u e s t i o n
+26 Recommend this on Google
104 comments:
blogsbyalo 10/29/10, 12:17 PM great job!!
Ask C Questions
Reply
Making a C program, to record the subjects taken by a student, the subjects removed, the approved and di and calculate the GPA for that semester.
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
21/35
9/24/13
Anonymous 12/8/10, 1:24 AM Superb collection..thanks !! just one bug to notify in Q.14..printf("Size of structure is: %d",*ptr); *ptr should be changed to ptr Reply
Anonymous 12/8/10, 11:36 AM Question 14 is correct one. No bug. It will work only Turbo c3.0 Reply
Anonymous 12/14/10, 9:50 AM woov very good post.. thanks a lot to author... Reply
Anonymous 2/9/11, 10:14 PM i want a c program that will display this output: ABCDEFGFEDCBA ABCDEFFEDCBA ABCDEEDCBA ABCDDCBA ABCCBA ABBA AA Reply Replies Narottam Singh MCA 1/14/12, 4:36 PM // This program is written in JAVA language .Which language u r using u can change public class BB5 { public static void main(String aa[]) { int n=20; int a=1; int b=n/2; int c=65+b; for(int k=1;k<=(n/2+1);k++) { for(int i=65;i<=c;i++) { System.out.printf("%c",i); } for(int j=65+b;j>=65;j--) { System.out.printf("%c",j); } c--; b--; System.out.println(); } } }
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
22/35
9/24/13
Anonymous 5/31/13, 9:48 AM #include int main (){ unsigned int j; unsigned char i; for(j=0;j<7;j++){ for(i = 'a';i <= ('g' - j);i++) printf("%c", i); for(i = ('g' - j);i >= 'a';i--) printf("%c", i); printf("\r\n"); } return ; } Reply
Anonymous 2/12/11, 9:11 PM Wonderful site.The effort of the site-creator is commendable.Keep it up.Your info. was quite useful. Reply
Anonymous 2/22/11, 12:00 AM #include void main() { int no_of_lines, alphabet = 65, i, count, j; printf("\nenter the number of lines you want to print\t:"); scanf("%d",&no_of_lines); count=2*no_of_lines; for(j=0;j<no_of_lines;j++) { if(j==0) { printf("\n\n"); for(i=0;i<count;i++) { if(i<no_of_lines) { printf(" %c", alphabet++); } else if(i == no_of_lines) { alphabet--; } else { printf(" %c",--alphabet); } } } else { printf("\n"); //printf("\nnothing\n"); for(i=0;i<count-2*j;i++) { if(i<no_of_lines-j) { printf(" %c", alphabet++); }
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
23/35
9/24/13
SAMPLE OUTPUT: enter the number of lines you want to print : 5 ABCDEDCBA ABCDDCBA ABCCBA ABBA AA if u want dat particular format enter the number of lines as 7.... Reply
Anonymous 3/13/11, 3:09 AM Great work ..Lots of hard work ...thanks a lot..becz it helps me a lot Reply
Anil Kumar 3/17/11, 8:30 AM main() { float a=0.7; if(a<0.7) printf("c"); else printf("c++"); } output:c Can anybody explain this plz Reply Replies Anonymous 2/10/12, 3:54 PM yup the (0.7) in the if statement is by default double type and float is always less as to double!! so,float a=0.7 is always less than (0.7 which has it's default datatype double)!! :-)
In the above program a is float value and 0.7 value directly substituted in program that value take datatype. -- float takes after dot(.) 8 zero's. -- Double takes after dot(.) 16 zero's. so.....float is always less than double. Output of this program is C Reply
Ritesh kumar 3/18/11, 1:10 PM Hi Anil, Check the question(4) of following link http://cquestionbank.blogspot.com/2010/04/c-questions-answers.html I think It will help you. Reply Replies
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
24/35
9/24/13
Raghu 4/13/11, 5:32 PM main() { float a=0.7; if(a<0.7) printf("c"); else printf("c++"); }
Exp: in the above program the compiler take it('a') as 0.7000001,so a<0.7 i.e true.so ,it's o/p is "c". Reply
Anonymous 4/23/11, 11:29 AM its not enough to learn "c" need some more, this is very nice collection,thank full to you Reply
Anonymous 5/3/11, 10:40 PM void main() { int i; char j; for(i=71;i>=65;i--) { for(j=65;j<=i;j++) { printf("%c",j); } printf("\n"); }
Anonymous 5/3/11, 10:49 PM void main() { int i; char j,k; for(i=71;i>=65;i--) { for(j=65;j<=i;j++) { printf("%c",j); } for(k=i;k>=65;k--) { printf("%c",k); } printf("\n"); }
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
25/35
9/24/13
C is a very interesting language and this is a basic of all language, if we have no knowledge of c the understand c++, this is a 1st stage of all programing language. Reply
java tutorial 6/2/11, 6:13 PM Great! this post is very help for me. Reply
awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awes work..............:)))))) Reply
Talib Hussain 8/17/11, 7:39 PM all questions are very easy questions pls post difficult question and their answers Reply
Gajanan 8/20/11, 2:38 PM Thanks u vary much to create such super blog Reply
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
26/35
9/24/13
thank you sooooooooooooooooooooooo much...i find these questions so very useful...i could now confident placement interviews..thanks once again.. Reply
Anonymous 8/24/11, 5:39 PM I need answer for this question immediately before 3 hrs .. pls help me 1.write a c program to divide the no. 73897869by 256 without using +,-,/,* and loop statement?? Reply
write 2 main () independent functions without using comments in a single program..pls help me friends i need t the answer immediately Reply
Tanmay Chakrabarty 8/26/11, 12:52 PM Wow....thats great. I have my Class Notes on C Programming . I shared them in my blog Tanmay On Run But your posts are much more helpful, My post will be helpful for class notes. But these posts are helpful for Nice to find your blog. Reply
jignesh 9/8/11, 2:27 AM This is awesome post and good imformation C interview questions Reply
anurag_dake 9/8/11, 10:27 AM 1)void main() { float a=2.1; if(a==2.1) printf("TE"); else printf("BE"); getch(); } -----------------------------------------------------Whats the OUTPUT of Following Program 2)void main() { float a=2.0; if(a==2.0) printf("TE"); else printf("BE"); getch(); } give Ans with reason....:) Reply
Hi Anurag, Please check the question (1) of the following link: http://cquestionbank.blogspot.com/2009/09/c-operator-que detial.html I hope it will help you. Reply
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
27/35
9/24/13
Anonymous 10/12/11, 10:34 PM i didnt even expect this much of material ..thanq :) i think it definitly helps me alot..:) Reply
In the program for dangling pointer if ptr=call() is written before clrscr() then it prints garbage value ...if written after it prints 26 correctly......Plz explain this.. turbo C Reply
Anonymous 11/5/11, 11:07 PM Write a program for a GENERAL NUMBER CONVERTERS which include binary, decimal, octa and hexadecimal. You need to write the program using C language. Reply
Ritesh kumar 11/6/11, 10:43 AM Hi, I hope this link will help you http://cquestionbank.blogspot.com/2010/07/c-program-examples.html Check Conversion ( Number System ) section Reply
Unknown 11/8/11, 1:10 AM well frnd i have a question--why the constructor in c++ can't be virtual but destructor can be? Reply
Anonymous 11/17/11, 3:33 PM I really appreciate this. I shall donate some to this site. Reply
Priyank Gupta 12/11/11, 7:15 AM This is very use full for students....
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
28/35
9/24/13
Anonymous 12/14/11, 7:56 PM Anyone plz peast link to find turbo C for windows-7. i have turboC.exe setup but not working properlly. Reply
Zaad 12/14/11, 8:08 PM Count the total words in a sentence,count once if word repeatting without using lib function. eg- my name is jawed,my pet name is dog. Answer-6 Reply
raviteja 12/21/11, 1:33 PM void main() { float a=2.1; if(a==2.1) printf("TE"); else printf("BE"); getch(); }
In the above program a is float value but 2.1 value directly substituted in program taht value take double dataty -- float takes after dot(.) 8 zero's. -- Double takes after dot(.) 16 zero's. so.....float is not equal to double. ans is BE. Reply Replies hitesh 6/9/13, 6:42 PM above is right Reply
write a program to find the rank of the number in the one dimensional array without using sorting and using two Reply
admin 1/5/12, 1:59 AM nice job i didn't see this type of stuff .Why don't you make website, we will made website with low price sankar00002009@gmail.com Reply
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
29/35
9/24/13
sudhir rajput 1/14/12, 6:15 PM #include #include void main() { int i,j; clrscr(); for(i=9;i>=1;i++) { for(j=i-1;j<=i;j--) { printf("%d",j); } printf("\n"); } getch(); } Reply
I Think of your talents as the things youre really good at. Theyre like personality traits. For instance, you may creative person, or a person whos really good at attending to details or a person with a gift for communica talents are the base for any successful business venture, including a home-based business. Reply
" Reply
Cbse sample paper 3/31/12, 5:40 PM very well written and organized tutorialsits indeed a great help for beginners like me to keep up the interest same time learn this important subject. Cbse Entrancei Reply
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
30/35
9/24/13
Deals 2 Buy 11/26/12, 12:40 AM Thanks a lot. this helps a lot for fast revision of C. Reply
Shubhabrata Naha 1/24/13, 10:05 PM *hi can u suggest me a good ebook for Recursion in C?? I cant understand recursion :( plz help me out... Reply Replies ritesh kumar 1/25/13, 8:47 AM
Shubharata, I hope this link will help you: How to write function recursion program in easier way Reply
Anonymous 2/26/13, 8:43 AM can u write a code of this output: Enter a number:12345 :23451 :34512 :45123 :51234 The highest number:51234 Reply Replies Anonymous 8/28/13, 2:54 PM #include #include char * rotate(char *str) { char *cp = str; char ch = *cp++; int i; while (*cp) { *(cp-1) = *cp++; } *(cp-1) = ch; return str; } void shuffle(char *str) { long bigval = 0; int i; long val = 0; printf("Shuffling...\n"); for (i=0; i < strlen(str); i++) {
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
31/35
9/24/13
Anonymous 2/26/13, 8:46 AM and this.. Enter a length of line:5 Enter P1:maria Enter P1:greg Enter P1:juan Enter P1:bitoy Enter P1:melai SAVE:4 I'LL wait ur reply.. i need it so badly Reply
Anonymous 2/28/13, 7:19 PM i need a program for this 1 23 456 7 8 9 10 Reply Replies hitesh 6/9/13, 10:59 PM void main() { int j,i,k; k=1; for(i=1;i<=4;i++) { for(j=i;j<=i;j++) { printf("%d",k); k++; } printf("/n"); } }
rakesh 7/21/13, 11:42 AM // this is correct , just check it , run it #include "stdio.h" int main() { int j,i,k; k=1; for(i=1;i<=4;i++) { for(j=0;j<i;j++) { printf("%d ",k);
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
32/35
9/24/13
Anonymous 3/1/13, 12:23 PM #include #include void main() { printf("1 23 456 7 8 9 10"); getch(); } Reply
hii frnds, i am starting to learn C programming language ....but it seems so difficult, i m studying "LET US C".It to understand the concept of looping & Decision making questions...so frnds please me guideline how can i im learning....coz i want to make my carier in programming. Reply
Anonymous 4/1/13, 11:49 PM Please add some more question like.. 1.Diff. btw c and c++, 2.Diff btw c++,C,java. 3.what is deceleration and definition. Reply
venki 5/2/13, 9:57 PM Thank's for providing valuable information,it help's to me............ Reply
Sumit Gupta 5/14/13, 2:22 PM Kudos to the Blogger! Keep up your good work. Reply
Anonymous 6/6/13, 6:41 PM hey have you done programming using calloc and malloc? I am not able to find out...plz tell me where it is? Reply
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
33/35
9/24/13
Anonymous 7/2/13, 6:40 PM what is the output for following query: 1.select greatest(94,'845','846') from dual; 2.select greatest('94','845',846) from dual; can anyone explain me plz Reply
Unknown 8/7/13, 1:45 PM how to write a c program to find birth year by NIC number Reply
hi frds i need ur help can anybody tell me the program for this algorithm??plz send to my mail id sasiviji95@gm soon as possible plz frds it's my request,, write a c++ program to print the following triangle 5 45 345 2345 12345 algorithm: s1:start the program s2: declare i,jand n as int data type s3:read the number of lines s4:fori=n to greater then or equal to 0 s4.1:for j=i to less than n print y s5: stop the program output: enter number of lines 5 1 12 123 1234 12345 Reply Replies Anonymous 9/13/13, 11:06 PM plz type the program this output display in c lang Reply
kairam 9/14/13, 7:11 AM your blog is soo use full and ur c skills are awesm :) Reply
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
34/35
9/24/13
Comment as:
Google Account
Publish
Preview
Home
MUST VISIT
www.cquestions.com/2010/10/c-interview-questions-and-answers.html
35/35