SlideShare ist ein Scribd-Unternehmen logo
1 von 103
Downloaden Sie, um offline zu lesen
hirist 
.com 
www.hirist.com 
TOP 100 
INTERVIEW QUESTIONS & ANSWERS 
C
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhoinventedCLanguage? 
2 
QUESTION 
DennisRitchiein1972developedanewlanguagebyinheritingthefeaturesofbothBCPLandBandaddingadditionalfeatures.HenamedthelanguageasjustC 
ANSWER 
QUESTION 1
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatarethefeaturesofCLangauges? 
3 
QUESTION 
•InConecanwriteprogramslikethatofhighlevellanguagesasinCOBOL,BASIC,FORTRANetc.aswellasitpermitsverycloseinteractionwiththeinnerworkingsofthecomputer. 
•Itisageneralpurposeprogramminglanguage.Itisusuallycalledsystemprogramminglanguagebutequallysuitedtowritingavarietyofapplications. 
•Itsupportsvariousdatatypes 
•Itfollowstheprogrammingstylebasedonfundamentalcontrolflowconstructionsforstructuredprogramming 
•Functionsmaybepre–definedoruserdefinedandtheymayreturnvaluesofbasictypes,structures,unionsorpointers 
ANSWER 
QUESTION 2
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whataretheadvantagesofclanguage? 
4 
QUESTION 
•Easytowrite 
•Richsetofoperatorsandfunctionsthatarebuilt–in 
•Supportforbit–wiseoperation 
•Flexibleuseofpointers 
•Directcontroloverthehardware 
•AbilitytoaccessBIOS/DOSroutines 
•InteractingusingInterrupts 
•AbilitytowriteTSRprograms 
•Abilitytocreate.COMfiles 
•Abilitytocreatelibraryfiles(.LIB) 
•Abilitytowriteinterfaceprograms 
•IncorporatingassemblylanguageinCprogram 
ANSWER 
QUESTION 3
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaheaderfile? 
5 
QUESTION 
Headerfilesprovidethedefinitionsanddeclarationsforthelibraryfunctions.Thus,eachheaderfilecontainsthelibraryfunctionsalongwiththenecessarydefinitionsanddeclarations.Forexample,stdio.h,math.h,stdlib.h, string.hetc. 
ANSWER 
QUESTION 4
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
ListthedifferenttypesofCtokens? 
6 
QUESTION 
•Constants 
•Identifiers 
•Keywords 
•Operators 
•Specialsymbols 
•Strings 
ANSWER 
QUESTION 5
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaconstant?Whatarethedifferenttypesofconstants? 
7 
QUESTION 
Aconstantisavaluethatdoesnotchangeduringtheprogramexecution.AconstantusedinCdoesnotoccupymemory.Therearefivetypesofconstants.Theyare: 
•Integerconstants 
•Floatingpointconstants 
•Characterconstants 
•Stringliterals 
•Enumerationconstants 
ANSWER 
QUESTION 6
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatarethedifferenttypesofcinstructions? 
8 
QUESTION 
•TherearebasicallythreetypesofinstructionsinCare: 
•TypeDeclarationInstruction 
•ArithmeticInstruction 
•ControlInstruction 
ANSWER 
QUESTION 7
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhyCiscalledamiddlelevellanguage? 
9 
QUESTION 
CcombinesthefeaturesofbothAssemblyLevelLanguages(LowLevelLanguages)andHigherLevelLanguages. Forthisreason,CisreferredtoasaMiddleLevelLanguage.ThefeatureofALLsisthatofenablingustodevelopsystemlevelprogramsandthefeaturesofHLLsarethoseofhigherdegreeofreadabilityandmachine independence. 
ANSWER 
QUESTION 8
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisthepurposeofmain()function? 
10 
QUESTION 
•Thefunctionmain()invokesotherfunctionswithinit.Itisthefirstfunctiontobecalledwhentheprogramstartsexecution. 
•Itisthestartingfunction. 
•Itreturnsanintvaluetotheenvironmentthatcalledtheprogram. 
•Recursivecallisallowedformain()also. 
•Itisauser-definedfunction. 
ANSWER 
QUESTION 9
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatismeantbytypespecifiers? 
11 
QUESTION 
Typespecifiersdecidetheamountofmemoryspaceoccupiedbyavariable.Intheeaseofintegraltypes;italsoexplicitlystatestherangeofvaluesthattheobjectcanhold. 
ANSWER 
QUESTION 10
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisthedifferencebetweensinglecharaterconstantandstringconstant? 
12 
QUESTION 
•Asinglecharacterconstantconsistsofonlyonecharacteranditisenclosedwithinapairofsinglequotes. 
•Astringconstantconsistsofoneormorecharactersanditisenclosedwithinapairofdoublequotes. 
ANSWER 
QUESTION 11
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaloop? 
13 
QUESTION 
Aloopisaprocesstodoajobrepeatedlywithpossiblydifferentdataeachtime.Thestatementsexecutedeachtimeconstitutetheloopbody,andeachpassiscallediteration.Aconditionmustbepresenttoterminatetheloop. 
ANSWER 
QUESTION 12
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatarethetypesofdatatypesandexplain? 
14 
QUESTION 
TherearefivebasicDatatypesinC.Theseare: 
•void:meansnothingi.e.nodatainvolvementinanaction 
•char:toworkwithalltypesofcharactersusedincomputeroperations 
•int:toworkwithanintegertypeofdatainanycomputationalwork 
•float:toworkwiththerealtypeofdataorscientificnumbersintheexponentialform 
•double:toworkwithdoubleprecisionofnumberswhentheapproximationisverycrucial. 
ANSWER 
QUESTION 13
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthegeneralformofaCprogram? 
15 
QUESTION 
ACprogrambeginswiththepreprocessordirectives,inwhichtheprogrammerwouldspecifywhichheaderfileandwhatconstants(ifany)tobeused.Thisisfollowedbythemainfunctionheading.Withinthemainfunctionliesthevariabledeclarationandprogramstatement. 
ANSWER 
QUESTION 14
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferencebetweenCallbyValueandCallbyReference? 
16 
QUESTION 
WhenusingCallbyValue,youaresendingthevalueofavariableasparametertoafunction,whereasCallbyReferencesendstheaddressofthevariable.Also,underCallbyValue,thevalueintheparameterisnotaffectedbywhateveroperationthattakesplace,whileinthecaseofCallbyReference,valuescanbeaffectedbytheprocesswithinthefunction. 
ANSWER 
QUESTION 15
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisastack? 
17 
QUESTION 
Astackisoneformofadatastructure.DataisstoredinstacksusingtheFILO(FirstInLastOut)approach.Atanyparticularinstance,onlythetopofthestackisaccessible,whichmeansthatinordertoretrievedatathatisstoredinsidethestack,thoseontheupperpartshouldbeextractedfirst.StoringdatainastackisalsoreferredtoasaPUSH,whiledataretrievalisreferredtoasaPOP. 
ANSWER 
QUESTION 16
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatistheuseofa„0′character? 
18 
QUESTION 
Itisreferredtoasaterminatingnullcharacter,andisusedprimarilytoshowtheendofastringvalue. 
ANSWER 
QUESTION 17
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisthedifferencebetweenthe=symboland==symbol? 
19 
QUESTION 
The=symbolisoftenusedinmathematicaloperations.Itisusedtoassignavaluetoagivenvariable.Ontheotherhand,the==symbol,alsoknownas“equalto”or“equivalentto”,isarelationaloperatorthatisusedtocomparetwovalues 
ANSWER 
QUESTION 18
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisthemodulusoperator? 
20 
QUESTION 
Themodulusoperatoroutputstheremainderofadivision.Itmakesuseofthepercentage(%)symbol.Forexample: 10%3=1,meaningwhenyoudivide10by3,theremainderis1. 
ANSWER 
QUESTION 19
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whichofthefollowingoperatorsisincorrectandwhy?(>=,<=,<>,==) 
21 
QUESTION 
<>isincorrect.Whilethisoperatoriscorrectlyinterpretedas“notequalto”inwritingconditionalstatements,itisnottheproperoperatortobeusedinCprogramming.Instead,theoperator!=mustbeusedtoindicate“notequalto”condition. 
ANSWER 
QUESTION 20
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatissyntaxerror? 
22 
QUESTION 
Syntaxerrorsareassociatedwithmistakesintheuseofaprogramminglanguage.Itmaybeacommandthatwasmisspelledoracommandthatmustwasenteredinlowercasemodebutwasinsteadenteredwithanuppercasecharacter.Amisplacedsymbol,orlackofsymbol,somewherewithinalineofcodecanalsoleadtosyntaxerror. 
ANSWER 
QUESTION 21
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
CanIuse“int”datatypetostorethevalue32768?Why? 
23 
QUESTION 
No.“int”datatypeiscapableofstoringvaluesfrom-32768to32767.Tostore32768,youcanuse“longint”instead. Youcanalsouse“unsignedint”,assumingyoudon‟tintendtostorenegativevalues. 
ANSWER 
QUESTION 22
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whenisthe“void”keywordusedinafunction? 
24 
QUESTION 
Whendeclaringfunctions,youwilldecidewhetherthatfunctionwouldbereturningavalueornot.Ifthatfunctionwillnotreturnavalue,suchaswhenthepurposeofafunctionistodisplaysomeoutputsonthescreen,then“void”istobeplacedattheleftmostpartofthefunctionheader.Whenareturnvalueisexpectedafterthefunctionexecution,thedatatypeofthereturnvalueisplacedinsteadof“void”. 
ANSWER 
QUESTION 23
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthesignificanceofanalgorithmtoCprogramming? 
25 
QUESTION 
Beforeaprogramcanbewritten,analgorithmhastobecreatedfirst.Analgorithmprovidesastepbystepprocedureonhowasolutioncanbederived.Italsoactsasablueprintonhowaprogramwillstartandend, includingwhatprocessandcomputationsareinvolved. 
ANSWER 
QUESTION 24
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
HowdoyougeneraterandomnumbersinC? 
26 
QUESTION 
RandomnumbersaregeneratedinCusingtherand()command.Forexample:anyNum=rand()willgenerateanyintegernumberbeginningfrom0,assumingthatanyNumisavariableoftypeinteger. 
ANSWER 
QUESTION 25
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisdebugging? 
27 
QUESTION 
Debuggingistheprocessofidentifyingerrorswithinaprogram.Duringprogramcompilation,errorsthatarefoundwillstoptheprogramfromexecutingcompletely.Atthisstate,theprogrammerwouldlookintothepossibleportionswheretheerroroccurred.Debuggingensurestheremovaloferrors,andplaysanimportantroleinensuringthattheexpectedprogramoutputismet. 
ANSWER 
QUESTION 26
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatdoesthe&&operatordoinaprogramcode? 
28 
QUESTION 
The&&isalsoreferredtoasANDoperator.Whenusingthisoperator,allconditionsspecifiedmustbeTRUEbeforethenextactioncanbeperformed.Ifyouhave10conditionsandallbut1failstoevaluateasTRUE,theentireconditionstatementisalreadyevaluatedasFALSE. 
ANSWER 
QUESTION 27
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatis||operatorandhowdoesitfunctioninaprogram? 
29 
QUESTION 
The||isalsoknownastheORoperatorinCprogramming.Whenusing||toevaluatelogicalconditions,anyconditionthatevaluatestoTRUEwillrendertheentireconditionstatementasTRUE. 
ANSWER 
QUESTION 28
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatwillbetheoutcomeofthefollowingconditionalstatementifthevalueofvariablesis10?s>=10&&s<25&&s!=12 
30 
QUESTION 
TheoutcomewillbeTRUE.Sincethevalueofsis10,s>=10evaluatestoTRUEbecausesisnotgreaterthan10butisstillequalto10.s<25isalsoTRUEsince10islessthen25.Justthesame,s!=12,whichmeanssisnotequalto12,evaluatestoTRUE.The&&istheANDoperator,andfollowstherulethatifallindividualconditionsareTRUE,theentirestatementisTRUE. 
ANSWER 
QUESTION 29
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisFIFO? 
31 
QUESTION 
InCprogramming,thereisadatastructureknownasqueue.Inthisstructure,dataisstoredandaccessedusingFIFOformat,orFirst-In-First-Out.Aqueuerepresentsalinewhereinthefirstdatathatwasstoredwillbethefirstonethatisaccessibleaswell. 
ANSWER 
QUESTION 30
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
InClanguage,thevariablesNAME,name,andNameareallthesame.TRUEorFALSE? 
32 
QUESTION 
FALSE.Clanguageisacasesensitivelanguage.Therefore,NAME,nameandNamearethreeuniquelydifferentvariables. 
ANSWER 
QUESTION 31
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whenisa“switch”statementpreferableoveran“if”statement? 
33 
QUESTION 
Theswitchstatementisbestusedwhendealingwithselectionsbasedonasinglevariableorexpression.However, switchstatementscanonlyevaluateintegerandcharacterdatatypes. 
ANSWER 
QUESTION 32
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisgets()function? 
34 
QUESTION 
Thegets()functionallowsafulllinedataentryfromtheuser.Whentheuserpressestheenterkeytoendtheinput, theentirelineofcharactersisstoredtoastringvariable.Notethattheenterkeyisnotincludedinthevariable,butinsteadanullterminator0isplacedafterthelastcharacter. 
ANSWER 
QUESTION 33
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
DifferencebetweenSyntaxandlogicalerror? 
35 
QUESTION 
Syntaxerror: 
Theseinvolvesvalidationofsyntaxoflanguage 
Compilerprintsdiagnosticmessage. 
Logicalerror: 
Logicalerrorarecausedbyanincorrectalgorithmorbyastatementmistypedinsuchawaythatitdoesn‟tvioletsyntaxoflanguage. 
Itisdifficulttofind. 
ANSWER 
QUESTION 34
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisstaticmemoryallocation? 
36 
QUESTION 
Compilerallocatesmemoryspaceforadeclaredvariable.Byusingtheaddressofoperator,thereservedaddressisobtainedandthisaddressisassignedtoapointervariable.Thiswayofassigningpointervaluetoapointervariableatcompilationtimeisknownasstaticmemoryallocation. 
ANSWER 
QUESTION 35
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisdynamicmemoryallocation? 
37 
QUESTION 
Adynamicmemoryallocationusesfunctionssuchasmalloc()orcalloc()togetmemorydynamically.Ifthesefunctionsareusedtogetmemorydynamicallyandthevaluesreturnedbythesefunctionareassignedtopointervariables,suchawayofallocatingmemoryatruntimeisknownasdynamicmemoryallocation. 
ANSWER 
QUESTION 36
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
ArePointersInteger? 
38 
QUESTION 
No,Pointersarenotintegers.Apointerisanaddress.Itisapositivenumber. 
ANSWER 
QUESTION 37
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Inheaderfileswhetherfunctionsaredeclaredordefined? 
39 
QUESTION 
Functionsaredeclaredwithinheaderfile.Thatisfunctionprototypesexistinaheaderfile,notfunctionbodies.Theyaredefinedinlibrary(lib). 
ANSWER 
QUESTION 38
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Differencebetweenstrdupandstrcpy? 
40 
QUESTION 
Bothcopyastring.Strcpywantsabuffertocopyinto.Strdupallocatesabufferusingmalloc().Unlikestrcpy(), strdup()isnotspecifiedbyANSI. 
ANSWER 
QUESTION 39
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisspaghettiprogramming? 
41 
QUESTION 
Spaghettiprogrammingreferstocodesthattendtogettangledandoverlappedthroughouttheprogram.Thisunstructuredapproachtocodingisusuallyattributedtolackofexperienceonthepartoftheprogrammer. Spaghettiprogramingmakesaprogramcomplexandanalyzingthecodesdifficult,andsomustbeavoidedasmuchaspossible. 
ANSWER 
QUESTION 40
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
InCprogramming,howdoyouinsertquotecharacters(„and“)intotheoutputscreen? 
42 
QUESTION 
Thisisacommonproblemforbeginnersbecausequotesarenormallypartofaprintfstatement.Toinsertthequotecharacteraspartoftheoutput,usetheformatspecifiers‟(forsinglequote),and”(fordoublequote). 
ANSWER 
QUESTION 41
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisanestedloop? 
43 
QUESTION 
Anestedloopisaloopthatrunswithinanotherloop.Putitinanothersense,youhaveaninnerloopthatisinsideanouterloop.Inthisscenario,theinnerloopisperformedanumberoftimesasspecifiedbytheouterloop.Foreachturnontheouterloop,theinnerloopisfirstperformed. 
ANSWER 
QUESTION 42
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Canthecurlybrackets{}beusedtoencloseasinglelineofcode? 
44 
QUESTION 
Whilecurlybracketsaremainlyusedtogroupseverallinesofcodes,itwillstillworkwithouterrorifyouuseditforasingleline.Someprogrammerspreferthismethodasawayoforganizingcodestomakeitlookclearer,especiallyinconditionalstatements. 
ANSWER 
QUESTION 43
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatarecompoundstatements? 
45 
QUESTION 
Compoundstatementsaremadeupoftwoormoreprogramstatementsthatareexecutedtogether.ThisusuallyoccurswhilehandlingconditionswhereinaseriesofstatementsareexecutedwhenaTRUEorFALSEisevaluated.Compoundstatementscanalsobeexecutedwithinaloop.Curlybrackets{}areplacedbeforeandaftercompoundstatements. 
ANSWER 
QUESTION 44
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaregistervariable? 
46 
QUESTION 
RegistervariablesarestoredintheCPUregisters.Itsdefaultvalueisagarbagevalue.Scopeofaregistervariableislocaltotheblockinwhichitisdefined.Lifetimeistillcontrolremainswithintheblockinwhichtheregistervariableisdefined.VariablestoredinaCPUregistercanalwaysbeaccessedfasterthantheonethatisstoredinmemory.Therefore,ifavariableisusedatmanyplacesinaprogram,itisbettertodeclareitsstorageclassasregister 
Example:registerintx=5; 
Variablesforloopcounterscanbedeclaredasregister.Notethatregisterkeywordmaybeignoredbysomecompilers. 
ANSWER 
QUESTION 45
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatissizeofvoidpointer? 
47 
QUESTION 
Sizeofanytypeofpointerincisindependentofdatatypewhichispointerispointingi.e.sizeofalltypeofpointer(near)incistwobyteeitheritischarpointer,doublepointer,functionpointerornullpointer.Voidpointerisnotexceptionofthisruleandsizeofvoidpointerisalsotwobyte. 
ANSWER 
QUESTION 46
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatareprintfandscanf,callbyreferenceorcallbyvalue? 
48 
QUESTION 
Printf:Callbyvalue 
Scanf:Callbyreference 
ANSWER 
QUESTION 47
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaconstpointer? 
49 
QUESTION 
aconstpointermeansthepointerwhichrepresentstheaddressofonevalue.soifyoudeclareapointerinsidethefunction,itdoesn'thavescopeoutsidethefunction.ifitisalsoavailabletotheoutsidefunctionwheneverwedeclareapointerasconst. 
ANSWER 
QUESTION 48
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whydoesn++executemuchfasterthann+1? 
50 
QUESTION 
n++takesmorethanoneinstruction,++nisfaster.n++hastostoren,incrementthevariableandreturnn,while++nincrementnandreturnwithoutstoringthepreviousvalueofn. 
ANSWER 
QUESTION 49
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatismodularProgramming? 
51 
QUESTION 
Ifaprogramislarge,itissubdividedintoanumberofsmallerprogramsthatarecalledmodulesorsubprograms.Ifacomplexproblemissolvedusingmoremodules,thisapproachisknownasmodularprogramming. 
ANSWER 
QUESTION 51
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whydoesn'tCsupportfunctionoverloading? 
52 
QUESTION 
OverloadingispolymorphismwhichisoneofthecharacteristicsofObjectorientedprogramming.CisnotandobjectorientedlanguagelikeC++orJava.Therefore,nooverloading,inheritance,etc. 
ANSWER 
QUESTION 51
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisanincompletetype? 
53 
QUESTION 
Incompletetypesreferstopointersinwhichthereisnonavailabilityoftheimplementationofthereferencedlocationoritpointstosomelocationwhosevalueisnotavailableformodification. 
ANSWER 
QUESTION 52
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
ExplaintheDifferencebetweenCandC++? 
54 
QUESTION 
CisthepredecessorofC++.C++isanObjectOriented,non-procedurallanguage,unlikeC,whichisaprocedurallanguage.C++treatsalldataandfunctionalhandlingintermsofObjectsandtheirrelationships. 
ANSWER 
QUESTION 53
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisNestinginC? 
55 
QUESTION 
Includingoneconstructedinsideanother,isnesting.Nestingcanbeastructureinsideanotherstructure,anif-elsestatementwithinanother,multiplewhileloops,oneinsidetheother.Continuingourearlierexample,ifyouhaveacollectionofbikes,insteadofgroupingthemseparately,youcannestthemwithinamainstructure,whichyoucanname“CollectionofBikes”. 
ANSWER 
QUESTION 54
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Howiscalloc()differentfrommalloc()? 
56 
QUESTION 
Themaindifferencebetweenthetwoisthatcalloc(),whenitisusedtoassignablockofmemory,theallocatedcontentsareinitializedto0.Malloc(),ontheotherhand,doesnotinitialisethememoryblockitassigns.Thememoryjusthasrandomvaluesleftoverfromprevioususage. 
ANSWER 
QUESTION 55
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatareDestructorsinCLanguage? 
57 
QUESTION 
Classifyingadestructoryoucancallitaclassobjectanditiscalledadestructoronceitgoesoutofscopeorgetsdeletedovertly.Thejobofadestructoristoputanendtoobjectsbeingproducedbyaconstructor.Justliketheconstructoryoucanconsiderdestructorafunctionalmemberanditisspecificallyknownbyaclassname. 
ANSWER 
QUESTION 56
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whataretheusesofapointer? 
58 
QUESTION 
Pointerisusedinthefollowingcases 
i)Itisusedtoaccessarrayelements 
ii)Itisusedfordynamicmemoryallocation. 
iii)ItisusedinCallbyreference 
iv)Itisusedindatastructuresliketrees,graph,linkedlistetc. 
ANSWER 
QUESTION 57
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaunion? 
59 
QUESTION 
Unionisacollectionofheterogeneousdatatypebutitusesefficientmemoryutilizationtechniquebyallocatingenoughmemorytoholdthelargestmember.Hereasingleareaofmemorycontainsvaluesofdifferenttypesatdifferenttime.Aunioncanneverbeinitialized. 
ANSWER 
QUESTION 58
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whataremacros?Whatareitsadvantagesanddisadvantages? 
60 
QUESTION 
Macrosareabbreviationsforlengthyandfrequentlyusedstatements.Whenamacroiscalledtheentirecodeissubstitutedbyasinglelinethoughthemacrodefinitionisofseverallines. 
Theadvantageofmacroisthatitreducesthetimetakenforcontroltransferasincaseoffunction. 
Thedisadvantageofitisheretheentirecodeissubstitutedsotheprogrambecomeslengthyifamacroiscalledseveraltimes. 
ANSWER 
QUESTION 59
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatareenumerations? 
61 
QUESTION 
Theyarealistofnamedinteger-valuedconstants.Example:enumcolor{black,orange=4,yellow,green,blue, violet};Thisdeclarationdefinesthesymbols“black”,“orange”,“yellow”,etc.tohavethevalues“1,”“4,”“5,”…etc. Thedifferencebetweenanenumerationandamacroisthattheenumactuallydeclaresatype,andthereforecanbetypechecked. 
ANSWER 
QUESTION 60
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatistheuseoftypedef? 
62 
QUESTION 
Thetypedefhelpineasiermodificationwhentheprogramsareportedtoanothermachine.Adescriptivenewnamegiventotheexistingdatatypemaybeeasiertounderstandthecode. 
ANSWER 
QUESTION 61
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferencebetweenStringsandArrays? 
63 
QUESTION 
StringisasequenceofcharactersendingwithNULL.itcanbetreatedasaonedimensionalarrayofcharactersterminatedbyaNULLcharacter. 
ANSWER 
QUESTION 62
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisanormalizedpointer,howdowenormalizeapointer? 
64 
QUESTION 
Itisa32bitpointer,whichhasasmuchofitsvalueinthesegmentregisteredaspossible.Sinceasegmentcanstartevery16bytessotheoffsetwillhaveavaluefrom0toF.fornormalizationconverttheaddressinto20bitaddressthenusethe16bitforsegmentaddressand4bitfortheoffsetaddress.Givenapointer500D:9407,weconvertittoa20bitabsoluteaddress549D7,Whichthennormalizedto549D:0007. 
ANSWER 
QUESTION 63
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisgenericpointerinC? 
65 
QUESTION 
InCvoid*actsasagenericpointer.Whenotherpointertypesareassignedtogenericpointer,conversionsareappliedautomatically(implicitconversion). 
ANSWER 
QUESTION 64
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Differencebetweenlinkerandlinkage? 
66 
QUESTION 
Linkerconvertsanobjectcodeintoanexecutablecodebylinkingtogetherthenecessarybuiltinfunctions.Theformandplaceofdeclarationwherethevariableisdeclaredinaprogramdeterminethelinkageofvariable. 
ANSWER 
QUESTION 65
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisafunction? 
67 
QUESTION 
Alargeprogramissubdividedintoanumberofsmallerprogramsorsubprograms.Eachsubprogramspecifiesoneormoreactionstobeperformedforthelargerprogram.Suchsubprogramsarecalledfunctions. 
ANSWER 
QUESTION 66
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisanargument? 
68 
QUESTION 
Anargumentisanentityusedtopassdatafromthecallingtoacalledfunction. 
ANSWER 
QUESTION 67
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WriteaprogramwhichemploysRecursion? 
69 
QUESTION 
intfact(intn){returnn>1?n*fact(n–1):1;} 
ANSWER 
QUESTION 68
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatdothe„c‟and„v‟inargcandargvstandfor? 
70 
QUESTION 
Thecinargc(argumentcount)standsforthenumberofcommandlineargumenttheprogramisinvokedwithandvinargv(argumentvector)isapointertoanarrayofcharacterstringthatcontainthearguments. 
ANSWER 
QUESTION 69
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatareCidentifiers? 
71 
QUESTION 
Thesearenamesgiventovariousprogrammingelementsuchasvariables,function,arrays.Itisacombinationofletter,digitandunderscore.Itshouldbeginwithletter.Backspaceisnotallowed. 
ANSWER 
QUESTION 70
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatdothefunctionsatoi(),itoa()andgcvt()do? 
72 
QUESTION 
atoi()isamacrothatconvertsintegertocharacter. 
itoa()Itconvertsanintegertostring 
gcvt()Itconvertsafloatingpointnumbertostring 
ANSWER 
QUESTION 71
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Howisfopen()used? 
73 
QUESTION 
Thefunctionfopen()returnsafilepointer.Henceafilepointerisdeclaredanditisassignedas 
FILE*fp; 
fp=fopen(filename,mode); 
filenameisastringrepresentingthenameofthefileandthemoderepresents: 
“r”forreadoperation 
“w”forwriteoperation 
“a”forappendoperation 
“r+”,”w+”,”a+”forupdateoperation 
ANSWER 
QUESTION 72
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisthepurposeofftell? 
74 
QUESTION 
Thefunctionftell()isusedtogetthecurrentfilerepresentedbythefilepointer. 
ftell(fp); 
returnsalongintegervaluerepresentingthecurrentfilepositionofthefilepointedbythe 
filepointerfp.Ifanerroroccurs,-1isreturned. 
ANSWER 
QUESTION 73
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Discussonpointerarithmetic? 
75 
QUESTION 
1.Assignmentofpointerstothesametypeofpointers. 
2.Addingorsubtractingapointerandaninteger. 
3.Subtractingorcomparingtwopointer. 
4.Incrementingordecrementingthepointerspointingtotheelementsofanarray.Whenapointertoanintegerisincrementedbyone,theaddressisincrementedbytwo.Itisdoneautomaticallybythecompiler. 
5.Assigningthevalue0tothepointervariableandcomparing0withthepointer.Thepointerhavingaddress0pointstonowhereatall. 
ANSWER 
QUESTION 74
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatistheinvalidpointerarithmetic? 
76 
QUESTION 
i)adding,multiplyinganddividingtwopointers. 
ii)Shiftingormaskingpointer. 
iii)Additionoffloatordoubletopointer. 
iv)Assignmentofapointerofonetypetoapointerofanothertype? 
ANSWER 
QUESTION 75
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Canweinitializeunions? 
77QUESTION 
ANSIStandardCallowsaninitializerforthefirstmemberofaunion.Thereisnostandardwayofinitializinganyothermember(nor,underapre-ANSIcompiler,istheregenerallyanywayofinitializingaunionatall). 
ANSWER 
QUESTION 76
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisOutputoffollowingcsnippet? 
intmain(){ 
char*s="Abhas"; 
printf("%s",s+2); 
getch(); 
} 
78 
QUESTION 
Has.Explanation:Intheaboveprogramroleof%sistodisplaythestringwhoseaddressispassedasanargument.Thisishowastandardprintfstatementworksinclanguage.Nowsincewehavepasseds+2asanargumentthereforefirstvalueofthisexpressionisevaluated.Here„s‟wouldrefertoaddressoffirstcharacterinstring„s‟.Nowprintfwouldgetaddressofthirdcharacter(addressoffirstcharacter+2)asargumentsoitwilldisplaythestringstartingfromthirdposition.Henceoutputwouldbe„has‟. 
ANSWER 
QUESTION 77
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisdifferencebetween.comprogramand.exeprogram? 
79 
QUESTION 
Both.comand.exeprogramareexecutableprogrambut.comprogramexecutesfasterthan.exeprogram.Alldriversare.comprogram..comfilehashigherpreferencethan.exe. 
ANSWER 
QUESTION 78
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
DescribeturbocCompiler? 
80 
QUESTION 
TurbocisanIDEprogramminglanguagecreatedbyBorland.TurboC3.0isbasedonMSDOSoperationsystem.Itisoneofthemostpopularccompilers.Ituses8086microprocessorwhichis16bitmicroprocessor.Ithas20addressbusesand16databus.Itswordlengthistwobyte. 
ANSWER 
QUESTION 79
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Outoffgets()andgets()whichfunctionissafetouseandwhy? 
81 
QUESTION 
Fgets()issaferthangets(),becausewecanspecifyamaximuminputlength.Neitheroneiscompletelysafe, becausethecompilercan‟tprovethatprogrammerwon‟toverflowthebufferhepasstofgets(). 
ANSWER 
QUESTION 80
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Differentiatebetweena“forloop”anda“whileloop”? 
82 
QUESTION 
Forexecutingasetofstatementsfixednumberoftimesweuse“forloop”whilewhenthenumberofiterationstobeperformedisnotknowninadvanceweuse“whileloop”. 
ANSWER 
QUESTION 81
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Isthereabuilt-infunctioninCthatcanbeusedforsortingdata? 
83 
QUESTION 
Yes,usetheqsort()function.Itisalsopossibletocreateuserdefinedfunctionsforsorting,suchasthosebasedontheballoonsortandbubblesortalgorithm. 
ANSWER 
QUESTION 82
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whataretheadvantagesanddisadvantagesofaheap? 
84 
QUESTION 
Storingdataontheheapisslowerthanitwouldtakewhenusingthestack.However,themainadvantageofusingtheheapisitsflexibility.That‟sbecausememoryinthisstructurecanbeallocatedandremoveinanyparticularorder.Slownessintheheapcanbecompensatedifanalgorithmwaswelldesignedandimplemented. 
ANSWER 
QUESTION 83
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
HowdoyouconvertstringstonumbersinC? 
85 
QUESTION 
Youcanwriteyouownfunctionstodostringtonumberconversions,orinsteaduseC‟sbuiltinfunctions.Youcanuseatoftoconverttoafloatingpointvalue,atoitoconverttoanintegervalue,andatoltoconverttoalongintegervalue. 
ANSWER 
QUESTION 84
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Createasimplecodefragmentthatwillswapthevaluesoftwovariablesnum1andnum2. 
86 
QUESTION 
inttemp; 
temp=num1; 
num1=num2; 
num2=temp; 
ANSWER 
QUESTION 85
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatistheuseofasemicolon(;)attheendofeveryprogramstatement? 
87 
QUESTION 
Ithastodowiththeparsingprocessandcompilationofthecode.Asemicolonactsasadelimiter,sothatthecompilerknowswhereeachstatementends,andcanproceedtodividethestatementintosmallerelementsforsyntaxchecking. 
ANSWER 
QUESTION 86
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatdoesthecharacters“r”and“w”meanwhenwritingprogramsthatwillmakeuseoffiles? 
88 
QUESTION 
“r”means“read”andwillopenafileasinputwhereindataistoberetrieved.“w”means“write”,andwillopenafileforoutput.Previousdatathatwasstoredonthatfilewillbeerased. 
ANSWER 
QUESTION 87
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhichfunctioninCcanbeusedtoappendastringtoanotherstring? 
89 
QUESTION 
Thestrcatfunction.Ittakestwoparameters,thesourcestringandthestringvaluetobeappendedtothesourcestring. 
ANSWER 
QUESTION 88
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisthedifferencebetweenfunctionsgetch()andgetche()? 
90 
QUESTION 
Bothfunctionswillacceptacharacterinputvaluefromtheuser.Whenusinggetch(),thekeythatwaspressedwillnotappearonthescreen,andisautomaticallycapturedandassignedtoavariable.Whenusinggetche(),thekeythatwaspressedbytheuserwillappearonthescreen,whileatthesametimebeingassignedtoavariable. 
ANSWER 
QUESTION 89
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatdoesthefunctiontoupper()do? 
91 
QUESTION 
Itisusedtoconvertanylettertoitsuppercasemode.Toupper()functionprototypeisdeclaredin<ctype.h>.Notethatthisfunctionwillonlyconvertasinglecharacter,andnotanentirestring. 
ANSWER 
QUESTION 90
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatarerun-timeerrors? 
92 
QUESTION 
Theseareerrorsthatoccurwhiletheprogramisbeingexecuted.Onecommoninstancewhereinrun-timeerrorscanhappeniswhenyouaretryingtodivideanumberbyzero.Whenrun-timeerrorsoccur,programexecutionwillpause,showingwhichprogramlinecausedtheerror. 
ANSWER 
QUESTION 91
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Isthisprogramstatementvalid?INT=10.50; 
93 
QUESTION 
AssumingthatINTisavariableoftypefloat,thisstatementisvalid.OnemaythinkthatINTisareservedwordandmustnotbeusedforotherpurposes.However,recallthatreservedwordsareexpressinlowercase,sotheCcompilerwillnotinterpretthisasareservedword. 
ANSWER 
QUESTION 92
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatiswrongwiththisprogramstatement?void=10; 
94 
QUESTION 
ThewordvoidisareservedwordinClanguage.Youcannotusereservedwordsasauser-definedvariable. 
ANSWER 
QUESTION 93
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatwouldhappentoXinthisexpression:X+=15;(assumingthevalueofXis5) 
95 
QUESTION 
X+=15isashortmethodofwritingX=X+15,soiftheinitialvalueofXis5,then5+15=20. 
ANSWER 
QUESTION 94
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Notallreservedwordsarewritteninlowercase.TRUEorFALSE? 
96 
QUESTION 
FALSE.Allreservedwordsmustbewritteninlowercase;otherwisetheCcompilerwouldinterpretthisasunidentifiedandinvalid. 
ANSWER 
QUESTION 95
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisfloatingpointconstants? 
97 
QUESTION 
Floating-pointconstantsarenumberswithdecimalparts.Afloating-pointconstantsconsistsof: 
Anintegralpart 
Adecimalpoint 
Afractionalpart 
Anexponentpart 
Anoptionalsuffix 
ANSWER 
QUESTION 96
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisthedifferencebetweenfreadandfwritefunction? 
98 
QUESTION 
Thefread()functionreturnsthenumberofitemsread.Thisvaluemaybelessthancountiftheendofthefileisreachedoranerroroccurs.Thefwrite()functionreturnsthenumberofitemswritten.Thisvaluewillequalcountunlessanerroroccurs. 
ANSWER 
QUESTION 97
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatismeantbyinheritance? 
99QUESTION 
Inheritanceistheprocessbywhichobjectsofoneclassacquirepropertiesofobjectsofanotherclass. 
ANSWER 
QUESTION 98
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaternaryoperatorinC? 
100 
QUESTION 
PerhapsthemostunusualoperatorinClanguageisonecalledtheconditionalexpressionoperator.UnlikeallotheroperatorsinCwhichareeitherunaryorbinaryoperatorstheconditionalexpressionoperatorisaternaryoperator; thatis,ittakesthreeoperands.Thetwosymbolsthatareusedtodenotethisoperatorarethequestionmark(?) andthecolon(:).Thefirstoperandisplacedbeforethe?,thesecondbetweenthe?andtheandthethirdafterthe:. 
ANSWER 
QUESTION 99
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Whatisunaryoperator? 
101 
QUESTION 
Theoperatorsthatactuponasingleoperandtoproduceanewvalueareknownasunaryoperators. 
ANSWER 
QUESTION 100
For the hottest C jobs, please visit www.hirist.com 
hirist 
.com 
Resources 
102 
http://www.fresherventure.net/frequently-asked-c-language-interview-questions- and-answers/ 
http://www.itechaleart.com/2014/06/top-100-c-interview-qa.html 
http://placement.freshersworld.com/power-preparation/technical-interview- questions/C-programming-answers-21419 
http://career.guru99.com/top-100-c-interview-questions-answers/ 
http://www.slideshare.net/vineetkumarsaini/top-c-language-interview-questions- and-answer 
http://www.cquestions.com/2010/10/c-interview-questions-and-answers.html 
http://placementsindia.blogspot.com/2007/10/basic-c-interview-questions.html 
https://www.udemy.com/blog/c-programming-questions/ 
http://crackaninterview.com/c-language-interview-questions/ 
http://www.cwithabhas.com/2013/09/simple-c-interview-questions-for-mass.html 
http://www.freejobalert.com/c-interview-questions/2891/
www.hirist.com 
TOP 100 
INTERVIEW QUESTIONS & ANSWERS 
C

Weitere ähnliche Inhalte

Andere mochten auch

50 common interview questions and answers
50 common interview questions and answers50 common interview questions and answers
50 common interview questions and answersKumar
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGAbhishek Dwivedi
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomeshpraveensomesh
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2Amit Kapoor
 
Gsm interview question answer
Gsm interview question  answerGsm interview question  answer
Gsm interview question answerEdward Kamara
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1ReKruiTIn.com
 

Andere mochten auch (8)

C interview Question and Answer
C interview Question and AnswerC interview Question and Answer
C interview Question and Answer
 
50 common interview questions and answers
50 common interview questions and answers50 common interview questions and answers
50 common interview questions and answers
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
 
Gsm interview question answer
Gsm interview question  answerGsm interview question  answer
Gsm interview question answer
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 

Kürzlich hochgeladen

WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)Delhi Call girls
 
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjLewisJB
 
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Biography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO GoogleBiography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO GoogleHafizMuhammadAbdulla5
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfSoham Mondal
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳anilsa9823
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..Masuk Ahmed
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...Call Girls in Nagpur High Profile
 
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual serviceanilsa9823
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls DubaiDark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls Dubaikojalkojal131
 
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...ranjana rawat
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...shivangimorya083
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士obuhobo
 

Kürzlich hochgeladen (20)

WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
 
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCeCall Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
 
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbj
 
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Biography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO GoogleBiography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO Google
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
 
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
 
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls DubaiDark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
 
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Warje ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
 

Top 100 C Interview Questions and Answers

  • 1. hirist .com www.hirist.com TOP 100 INTERVIEW QUESTIONS & ANSWERS C
  • 2. For the hottest C jobs, please visit www.hirist.com hirist .com WhoinventedCLanguage? 2 QUESTION DennisRitchiein1972developedanewlanguagebyinheritingthefeaturesofbothBCPLandBandaddingadditionalfeatures.HenamedthelanguageasjustC ANSWER QUESTION 1
  • 3. For the hottest C jobs, please visit www.hirist.com hirist .com WhatarethefeaturesofCLangauges? 3 QUESTION •InConecanwriteprogramslikethatofhighlevellanguagesasinCOBOL,BASIC,FORTRANetc.aswellasitpermitsverycloseinteractionwiththeinnerworkingsofthecomputer. •Itisageneralpurposeprogramminglanguage.Itisusuallycalledsystemprogramminglanguagebutequallysuitedtowritingavarietyofapplications. •Itsupportsvariousdatatypes •Itfollowstheprogrammingstylebasedonfundamentalcontrolflowconstructionsforstructuredprogramming •Functionsmaybepre–definedoruserdefinedandtheymayreturnvaluesofbasictypes,structures,unionsorpointers ANSWER QUESTION 2
  • 4. For the hottest C jobs, please visit www.hirist.com hirist .com Whataretheadvantagesofclanguage? 4 QUESTION •Easytowrite •Richsetofoperatorsandfunctionsthatarebuilt–in •Supportforbit–wiseoperation •Flexibleuseofpointers •Directcontroloverthehardware •AbilitytoaccessBIOS/DOSroutines •InteractingusingInterrupts •AbilitytowriteTSRprograms •Abilitytocreate.COMfiles •Abilitytocreatelibraryfiles(.LIB) •Abilitytowriteinterfaceprograms •IncorporatingassemblylanguageinCprogram ANSWER QUESTION 3
  • 5. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisaheaderfile? 5 QUESTION Headerfilesprovidethedefinitionsanddeclarationsforthelibraryfunctions.Thus,eachheaderfilecontainsthelibraryfunctionsalongwiththenecessarydefinitionsanddeclarations.Forexample,stdio.h,math.h,stdlib.h, string.hetc. ANSWER QUESTION 4
  • 6. For the hottest C jobs, please visit www.hirist.com hirist .com ListthedifferenttypesofCtokens? 6 QUESTION •Constants •Identifiers •Keywords •Operators •Specialsymbols •Strings ANSWER QUESTION 5
  • 7. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisaconstant?Whatarethedifferenttypesofconstants? 7 QUESTION Aconstantisavaluethatdoesnotchangeduringtheprogramexecution.AconstantusedinCdoesnotoccupymemory.Therearefivetypesofconstants.Theyare: •Integerconstants •Floatingpointconstants •Characterconstants •Stringliterals •Enumerationconstants ANSWER QUESTION 6
  • 8. For the hottest C jobs, please visit www.hirist.com hirist .com Whatarethedifferenttypesofcinstructions? 8 QUESTION •TherearebasicallythreetypesofinstructionsinCare: •TypeDeclarationInstruction •ArithmeticInstruction •ControlInstruction ANSWER QUESTION 7
  • 9. For the hottest C jobs, please visit www.hirist.com hirist .com WhyCiscalledamiddlelevellanguage? 9 QUESTION CcombinesthefeaturesofbothAssemblyLevelLanguages(LowLevelLanguages)andHigherLevelLanguages. Forthisreason,CisreferredtoasaMiddleLevelLanguage.ThefeatureofALLsisthatofenablingustodevelopsystemlevelprogramsandthefeaturesofHLLsarethoseofhigherdegreeofreadabilityandmachine independence. ANSWER QUESTION 8
  • 10. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisthepurposeofmain()function? 10 QUESTION •Thefunctionmain()invokesotherfunctionswithinit.Itisthefirstfunctiontobecalledwhentheprogramstartsexecution. •Itisthestartingfunction. •Itreturnsanintvaluetotheenvironmentthatcalledtheprogram. •Recursivecallisallowedformain()also. •Itisauser-definedfunction. ANSWER QUESTION 9
  • 11. For the hottest C jobs, please visit www.hirist.com hirist .com Whatismeantbytypespecifiers? 11 QUESTION Typespecifiersdecidetheamountofmemoryspaceoccupiedbyavariable.Intheeaseofintegraltypes;italsoexplicitlystatestherangeofvaluesthattheobjectcanhold. ANSWER QUESTION 10
  • 12. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisthedifferencebetweensinglecharaterconstantandstringconstant? 12 QUESTION •Asinglecharacterconstantconsistsofonlyonecharacteranditisenclosedwithinapairofsinglequotes. •Astringconstantconsistsofoneormorecharactersanditisenclosedwithinapairofdoublequotes. ANSWER QUESTION 11
  • 13. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisaloop? 13 QUESTION Aloopisaprocesstodoajobrepeatedlywithpossiblydifferentdataeachtime.Thestatementsexecutedeachtimeconstitutetheloopbody,andeachpassiscallediteration.Aconditionmustbepresenttoterminatetheloop. ANSWER QUESTION 12
  • 14. For the hottest C jobs, please visit www.hirist.com hirist .com Whatarethetypesofdatatypesandexplain? 14 QUESTION TherearefivebasicDatatypesinC.Theseare: •void:meansnothingi.e.nodatainvolvementinanaction •char:toworkwithalltypesofcharactersusedincomputeroperations •int:toworkwithanintegertypeofdatainanycomputationalwork •float:toworkwiththerealtypeofdataorscientificnumbersintheexponentialform •double:toworkwithdoubleprecisionofnumberswhentheapproximationisverycrucial. ANSWER QUESTION 13
  • 15. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisthegeneralformofaCprogram? 15 QUESTION ACprogrambeginswiththepreprocessordirectives,inwhichtheprogrammerwouldspecifywhichheaderfileandwhatconstants(ifany)tobeused.Thisisfollowedbythemainfunctionheading.Withinthemainfunctionliesthevariabledeclarationandprogramstatement. ANSWER QUESTION 14
  • 16. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisthedifferencebetweenCallbyValueandCallbyReference? 16 QUESTION WhenusingCallbyValue,youaresendingthevalueofavariableasparametertoafunction,whereasCallbyReferencesendstheaddressofthevariable.Also,underCallbyValue,thevalueintheparameterisnotaffectedbywhateveroperationthattakesplace,whileinthecaseofCallbyReference,valuescanbeaffectedbytheprocesswithinthefunction. ANSWER QUESTION 15
  • 17. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisastack? 17 QUESTION Astackisoneformofadatastructure.DataisstoredinstacksusingtheFILO(FirstInLastOut)approach.Atanyparticularinstance,onlythetopofthestackisaccessible,whichmeansthatinordertoretrievedatathatisstoredinsidethestack,thoseontheupperpartshouldbeextractedfirst.StoringdatainastackisalsoreferredtoasaPUSH,whiledataretrievalisreferredtoasaPOP. ANSWER QUESTION 16
  • 18. For the hottest C jobs, please visit www.hirist.com hirist .com Whatistheuseofa„0′character? 18 QUESTION Itisreferredtoasaterminatingnullcharacter,andisusedprimarilytoshowtheendofastringvalue. ANSWER QUESTION 17
  • 19. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisthedifferencebetweenthe=symboland==symbol? 19 QUESTION The=symbolisoftenusedinmathematicaloperations.Itisusedtoassignavaluetoagivenvariable.Ontheotherhand,the==symbol,alsoknownas“equalto”or“equivalentto”,isarelationaloperatorthatisusedtocomparetwovalues ANSWER QUESTION 18
  • 20. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisthemodulusoperator? 20 QUESTION Themodulusoperatoroutputstheremainderofadivision.Itmakesuseofthepercentage(%)symbol.Forexample: 10%3=1,meaningwhenyoudivide10by3,theremainderis1. ANSWER QUESTION 19
  • 21. For the hottest C jobs, please visit www.hirist.com hirist .com Whichofthefollowingoperatorsisincorrectandwhy?(>=,<=,<>,==) 21 QUESTION <>isincorrect.Whilethisoperatoriscorrectlyinterpretedas“notequalto”inwritingconditionalstatements,itisnottheproperoperatortobeusedinCprogramming.Instead,theoperator!=mustbeusedtoindicate“notequalto”condition. ANSWER QUESTION 20
  • 22. For the hottest C jobs, please visit www.hirist.com hirist .com Whatissyntaxerror? 22 QUESTION Syntaxerrorsareassociatedwithmistakesintheuseofaprogramminglanguage.Itmaybeacommandthatwasmisspelledoracommandthatmustwasenteredinlowercasemodebutwasinsteadenteredwithanuppercasecharacter.Amisplacedsymbol,orlackofsymbol,somewherewithinalineofcodecanalsoleadtosyntaxerror. ANSWER QUESTION 21
  • 23. For the hottest C jobs, please visit www.hirist.com hirist .com CanIuse“int”datatypetostorethevalue32768?Why? 23 QUESTION No.“int”datatypeiscapableofstoringvaluesfrom-32768to32767.Tostore32768,youcanuse“longint”instead. Youcanalsouse“unsignedint”,assumingyoudon‟tintendtostorenegativevalues. ANSWER QUESTION 22
  • 24. For the hottest C jobs, please visit www.hirist.com hirist .com Whenisthe“void”keywordusedinafunction? 24 QUESTION Whendeclaringfunctions,youwilldecidewhetherthatfunctionwouldbereturningavalueornot.Ifthatfunctionwillnotreturnavalue,suchaswhenthepurposeofafunctionistodisplaysomeoutputsonthescreen,then“void”istobeplacedattheleftmostpartofthefunctionheader.Whenareturnvalueisexpectedafterthefunctionexecution,thedatatypeofthereturnvalueisplacedinsteadof“void”. ANSWER QUESTION 23
  • 25. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisthesignificanceofanalgorithmtoCprogramming? 25 QUESTION Beforeaprogramcanbewritten,analgorithmhastobecreatedfirst.Analgorithmprovidesastepbystepprocedureonhowasolutioncanbederived.Italsoactsasablueprintonhowaprogramwillstartandend, includingwhatprocessandcomputationsareinvolved. ANSWER QUESTION 24
  • 26. For the hottest C jobs, please visit www.hirist.com hirist .com HowdoyougeneraterandomnumbersinC? 26 QUESTION RandomnumbersaregeneratedinCusingtherand()command.Forexample:anyNum=rand()willgenerateanyintegernumberbeginningfrom0,assumingthatanyNumisavariableoftypeinteger. ANSWER QUESTION 25
  • 27. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisdebugging? 27 QUESTION Debuggingistheprocessofidentifyingerrorswithinaprogram.Duringprogramcompilation,errorsthatarefoundwillstoptheprogramfromexecutingcompletely.Atthisstate,theprogrammerwouldlookintothepossibleportionswheretheerroroccurred.Debuggingensurestheremovaloferrors,andplaysanimportantroleinensuringthattheexpectedprogramoutputismet. ANSWER QUESTION 26
  • 28. For the hottest C jobs, please visit www.hirist.com hirist .com Whatdoesthe&&operatordoinaprogramcode? 28 QUESTION The&&isalsoreferredtoasANDoperator.Whenusingthisoperator,allconditionsspecifiedmustbeTRUEbeforethenextactioncanbeperformed.Ifyouhave10conditionsandallbut1failstoevaluateasTRUE,theentireconditionstatementisalreadyevaluatedasFALSE. ANSWER QUESTION 27
  • 29. For the hottest C jobs, please visit www.hirist.com hirist .com Whatis||operatorandhowdoesitfunctioninaprogram? 29 QUESTION The||isalsoknownastheORoperatorinCprogramming.Whenusing||toevaluatelogicalconditions,anyconditionthatevaluatestoTRUEwillrendertheentireconditionstatementasTRUE. ANSWER QUESTION 28
  • 30. For the hottest C jobs, please visit www.hirist.com hirist .com Whatwillbetheoutcomeofthefollowingconditionalstatementifthevalueofvariablesis10?s>=10&&s<25&&s!=12 30 QUESTION TheoutcomewillbeTRUE.Sincethevalueofsis10,s>=10evaluatestoTRUEbecausesisnotgreaterthan10butisstillequalto10.s<25isalsoTRUEsince10islessthen25.Justthesame,s!=12,whichmeanssisnotequalto12,evaluatestoTRUE.The&&istheANDoperator,andfollowstherulethatifallindividualconditionsareTRUE,theentirestatementisTRUE. ANSWER QUESTION 29
  • 31. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisFIFO? 31 QUESTION InCprogramming,thereisadatastructureknownasqueue.Inthisstructure,dataisstoredandaccessedusingFIFOformat,orFirst-In-First-Out.Aqueuerepresentsalinewhereinthefirstdatathatwasstoredwillbethefirstonethatisaccessibleaswell. ANSWER QUESTION 30
  • 32. For the hottest C jobs, please visit www.hirist.com hirist .com InClanguage,thevariablesNAME,name,andNameareallthesame.TRUEorFALSE? 32 QUESTION FALSE.Clanguageisacasesensitivelanguage.Therefore,NAME,nameandNamearethreeuniquelydifferentvariables. ANSWER QUESTION 31
  • 33. For the hottest C jobs, please visit www.hirist.com hirist .com Whenisa“switch”statementpreferableoveran“if”statement? 33 QUESTION Theswitchstatementisbestusedwhendealingwithselectionsbasedonasinglevariableorexpression.However, switchstatementscanonlyevaluateintegerandcharacterdatatypes. ANSWER QUESTION 32
  • 34. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisgets()function? 34 QUESTION Thegets()functionallowsafulllinedataentryfromtheuser.Whentheuserpressestheenterkeytoendtheinput, theentirelineofcharactersisstoredtoastringvariable.Notethattheenterkeyisnotincludedinthevariable,butinsteadanullterminator0isplacedafterthelastcharacter. ANSWER QUESTION 33
  • 35. For the hottest C jobs, please visit www.hirist.com hirist .com DifferencebetweenSyntaxandlogicalerror? 35 QUESTION Syntaxerror: Theseinvolvesvalidationofsyntaxoflanguage Compilerprintsdiagnosticmessage. Logicalerror: Logicalerrorarecausedbyanincorrectalgorithmorbyastatementmistypedinsuchawaythatitdoesn‟tvioletsyntaxoflanguage. Itisdifficulttofind. ANSWER QUESTION 34
  • 36. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisstaticmemoryallocation? 36 QUESTION Compilerallocatesmemoryspaceforadeclaredvariable.Byusingtheaddressofoperator,thereservedaddressisobtainedandthisaddressisassignedtoapointervariable.Thiswayofassigningpointervaluetoapointervariableatcompilationtimeisknownasstaticmemoryallocation. ANSWER QUESTION 35
  • 37. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisdynamicmemoryallocation? 37 QUESTION Adynamicmemoryallocationusesfunctionssuchasmalloc()orcalloc()togetmemorydynamically.Ifthesefunctionsareusedtogetmemorydynamicallyandthevaluesreturnedbythesefunctionareassignedtopointervariables,suchawayofallocatingmemoryatruntimeisknownasdynamicmemoryallocation. ANSWER QUESTION 36
  • 38. For the hottest C jobs, please visit www.hirist.com hirist .com ArePointersInteger? 38 QUESTION No,Pointersarenotintegers.Apointerisanaddress.Itisapositivenumber. ANSWER QUESTION 37
  • 39. For the hottest C jobs, please visit www.hirist.com hirist .com Inheaderfileswhetherfunctionsaredeclaredordefined? 39 QUESTION Functionsaredeclaredwithinheaderfile.Thatisfunctionprototypesexistinaheaderfile,notfunctionbodies.Theyaredefinedinlibrary(lib). ANSWER QUESTION 38
  • 40. For the hottest C jobs, please visit www.hirist.com hirist .com Differencebetweenstrdupandstrcpy? 40 QUESTION Bothcopyastring.Strcpywantsabuffertocopyinto.Strdupallocatesabufferusingmalloc().Unlikestrcpy(), strdup()isnotspecifiedbyANSI. ANSWER QUESTION 39
  • 41. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisspaghettiprogramming? 41 QUESTION Spaghettiprogrammingreferstocodesthattendtogettangledandoverlappedthroughouttheprogram.Thisunstructuredapproachtocodingisusuallyattributedtolackofexperienceonthepartoftheprogrammer. Spaghettiprogramingmakesaprogramcomplexandanalyzingthecodesdifficult,andsomustbeavoidedasmuchaspossible. ANSWER QUESTION 40
  • 42. For the hottest C jobs, please visit www.hirist.com hirist .com InCprogramming,howdoyouinsertquotecharacters(„and“)intotheoutputscreen? 42 QUESTION Thisisacommonproblemforbeginnersbecausequotesarenormallypartofaprintfstatement.Toinsertthequotecharacteraspartoftheoutput,usetheformatspecifiers‟(forsinglequote),and”(fordoublequote). ANSWER QUESTION 41
  • 43. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisanestedloop? 43 QUESTION Anestedloopisaloopthatrunswithinanotherloop.Putitinanothersense,youhaveaninnerloopthatisinsideanouterloop.Inthisscenario,theinnerloopisperformedanumberoftimesasspecifiedbytheouterloop.Foreachturnontheouterloop,theinnerloopisfirstperformed. ANSWER QUESTION 42
  • 44. For the hottest C jobs, please visit www.hirist.com hirist .com Canthecurlybrackets{}beusedtoencloseasinglelineofcode? 44 QUESTION Whilecurlybracketsaremainlyusedtogroupseverallinesofcodes,itwillstillworkwithouterrorifyouuseditforasingleline.Someprogrammerspreferthismethodasawayoforganizingcodestomakeitlookclearer,especiallyinconditionalstatements. ANSWER QUESTION 43
  • 45. For the hottest C jobs, please visit www.hirist.com hirist .com Whatarecompoundstatements? 45 QUESTION Compoundstatementsaremadeupoftwoormoreprogramstatementsthatareexecutedtogether.ThisusuallyoccurswhilehandlingconditionswhereinaseriesofstatementsareexecutedwhenaTRUEorFALSEisevaluated.Compoundstatementscanalsobeexecutedwithinaloop.Curlybrackets{}areplacedbeforeandaftercompoundstatements. ANSWER QUESTION 44
  • 46. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisaregistervariable? 46 QUESTION RegistervariablesarestoredintheCPUregisters.Itsdefaultvalueisagarbagevalue.Scopeofaregistervariableislocaltotheblockinwhichitisdefined.Lifetimeistillcontrolremainswithintheblockinwhichtheregistervariableisdefined.VariablestoredinaCPUregistercanalwaysbeaccessedfasterthantheonethatisstoredinmemory.Therefore,ifavariableisusedatmanyplacesinaprogram,itisbettertodeclareitsstorageclassasregister Example:registerintx=5; Variablesforloopcounterscanbedeclaredasregister.Notethatregisterkeywordmaybeignoredbysomecompilers. ANSWER QUESTION 45
  • 47. For the hottest C jobs, please visit www.hirist.com hirist .com Whatissizeofvoidpointer? 47 QUESTION Sizeofanytypeofpointerincisindependentofdatatypewhichispointerispointingi.e.sizeofalltypeofpointer(near)incistwobyteeitheritischarpointer,doublepointer,functionpointerornullpointer.Voidpointerisnotexceptionofthisruleandsizeofvoidpointerisalsotwobyte. ANSWER QUESTION 46
  • 48. For the hottest C jobs, please visit www.hirist.com hirist .com Whatareprintfandscanf,callbyreferenceorcallbyvalue? 48 QUESTION Printf:Callbyvalue Scanf:Callbyreference ANSWER QUESTION 47
  • 49. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisaconstpointer? 49 QUESTION aconstpointermeansthepointerwhichrepresentstheaddressofonevalue.soifyoudeclareapointerinsidethefunction,itdoesn'thavescopeoutsidethefunction.ifitisalsoavailabletotheoutsidefunctionwheneverwedeclareapointerasconst. ANSWER QUESTION 48
  • 50. For the hottest C jobs, please visit www.hirist.com hirist .com Whydoesn++executemuchfasterthann+1? 50 QUESTION n++takesmorethanoneinstruction,++nisfaster.n++hastostoren,incrementthevariableandreturnn,while++nincrementnandreturnwithoutstoringthepreviousvalueofn. ANSWER QUESTION 49
  • 51. For the hottest C jobs, please visit www.hirist.com hirist .com WhatismodularProgramming? 51 QUESTION Ifaprogramislarge,itissubdividedintoanumberofsmallerprogramsthatarecalledmodulesorsubprograms.Ifacomplexproblemissolvedusingmoremodules,thisapproachisknownasmodularprogramming. ANSWER QUESTION 51
  • 52. For the hottest C jobs, please visit www.hirist.com hirist .com Whydoesn'tCsupportfunctionoverloading? 52 QUESTION OverloadingispolymorphismwhichisoneofthecharacteristicsofObjectorientedprogramming.CisnotandobjectorientedlanguagelikeC++orJava.Therefore,nooverloading,inheritance,etc. ANSWER QUESTION 51
  • 53. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisanincompletetype? 53 QUESTION Incompletetypesreferstopointersinwhichthereisnonavailabilityoftheimplementationofthereferencedlocationoritpointstosomelocationwhosevalueisnotavailableformodification. ANSWER QUESTION 52
  • 54. For the hottest C jobs, please visit www.hirist.com hirist .com ExplaintheDifferencebetweenCandC++? 54 QUESTION CisthepredecessorofC++.C++isanObjectOriented,non-procedurallanguage,unlikeC,whichisaprocedurallanguage.C++treatsalldataandfunctionalhandlingintermsofObjectsandtheirrelationships. ANSWER QUESTION 53
  • 55. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisNestinginC? 55 QUESTION Includingoneconstructedinsideanother,isnesting.Nestingcanbeastructureinsideanotherstructure,anif-elsestatementwithinanother,multiplewhileloops,oneinsidetheother.Continuingourearlierexample,ifyouhaveacollectionofbikes,insteadofgroupingthemseparately,youcannestthemwithinamainstructure,whichyoucanname“CollectionofBikes”. ANSWER QUESTION 54
  • 56. For the hottest C jobs, please visit www.hirist.com hirist .com Howiscalloc()differentfrommalloc()? 56 QUESTION Themaindifferencebetweenthetwoisthatcalloc(),whenitisusedtoassignablockofmemory,theallocatedcontentsareinitializedto0.Malloc(),ontheotherhand,doesnotinitialisethememoryblockitassigns.Thememoryjusthasrandomvaluesleftoverfromprevioususage. ANSWER QUESTION 55
  • 57. For the hottest C jobs, please visit www.hirist.com hirist .com WhatareDestructorsinCLanguage? 57 QUESTION Classifyingadestructoryoucancallitaclassobjectanditiscalledadestructoronceitgoesoutofscopeorgetsdeletedovertly.Thejobofadestructoristoputanendtoobjectsbeingproducedbyaconstructor.Justliketheconstructoryoucanconsiderdestructorafunctionalmemberanditisspecificallyknownbyaclassname. ANSWER QUESTION 56
  • 58. For the hottest C jobs, please visit www.hirist.com hirist .com Whataretheusesofapointer? 58 QUESTION Pointerisusedinthefollowingcases i)Itisusedtoaccessarrayelements ii)Itisusedfordynamicmemoryallocation. iii)ItisusedinCallbyreference iv)Itisusedindatastructuresliketrees,graph,linkedlistetc. ANSWER QUESTION 57
  • 59. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisaunion? 59 QUESTION Unionisacollectionofheterogeneousdatatypebutitusesefficientmemoryutilizationtechniquebyallocatingenoughmemorytoholdthelargestmember.Hereasingleareaofmemorycontainsvaluesofdifferenttypesatdifferenttime.Aunioncanneverbeinitialized. ANSWER QUESTION 58
  • 60. For the hottest C jobs, please visit www.hirist.com hirist .com Whataremacros?Whatareitsadvantagesanddisadvantages? 60 QUESTION Macrosareabbreviationsforlengthyandfrequentlyusedstatements.Whenamacroiscalledtheentirecodeissubstitutedbyasinglelinethoughthemacrodefinitionisofseverallines. Theadvantageofmacroisthatitreducesthetimetakenforcontroltransferasincaseoffunction. Thedisadvantageofitisheretheentirecodeissubstitutedsotheprogrambecomeslengthyifamacroiscalledseveraltimes. ANSWER QUESTION 59
  • 61. For the hottest C jobs, please visit www.hirist.com hirist .com Whatareenumerations? 61 QUESTION Theyarealistofnamedinteger-valuedconstants.Example:enumcolor{black,orange=4,yellow,green,blue, violet};Thisdeclarationdefinesthesymbols“black”,“orange”,“yellow”,etc.tohavethevalues“1,”“4,”“5,”…etc. Thedifferencebetweenanenumerationandamacroisthattheenumactuallydeclaresatype,andthereforecanbetypechecked. ANSWER QUESTION 60
  • 62. For the hottest C jobs, please visit www.hirist.com hirist .com Whatistheuseoftypedef? 62 QUESTION Thetypedefhelpineasiermodificationwhentheprogramsareportedtoanothermachine.Adescriptivenewnamegiventotheexistingdatatypemaybeeasiertounderstandthecode. ANSWER QUESTION 61
  • 63. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisthedifferencebetweenStringsandArrays? 63 QUESTION StringisasequenceofcharactersendingwithNULL.itcanbetreatedasaonedimensionalarrayofcharactersterminatedbyaNULLcharacter. ANSWER QUESTION 62
  • 64. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisanormalizedpointer,howdowenormalizeapointer? 64 QUESTION Itisa32bitpointer,whichhasasmuchofitsvalueinthesegmentregisteredaspossible.Sinceasegmentcanstartevery16bytessotheoffsetwillhaveavaluefrom0toF.fornormalizationconverttheaddressinto20bitaddressthenusethe16bitforsegmentaddressand4bitfortheoffsetaddress.Givenapointer500D:9407,weconvertittoa20bitabsoluteaddress549D7,Whichthennormalizedto549D:0007. ANSWER QUESTION 63
  • 65. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisgenericpointerinC? 65 QUESTION InCvoid*actsasagenericpointer.Whenotherpointertypesareassignedtogenericpointer,conversionsareappliedautomatically(implicitconversion). ANSWER QUESTION 64
  • 66. For the hottest C jobs, please visit www.hirist.com hirist .com Differencebetweenlinkerandlinkage? 66 QUESTION Linkerconvertsanobjectcodeintoanexecutablecodebylinkingtogetherthenecessarybuiltinfunctions.Theformandplaceofdeclarationwherethevariableisdeclaredinaprogramdeterminethelinkageofvariable. ANSWER QUESTION 65
  • 67. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisafunction? 67 QUESTION Alargeprogramissubdividedintoanumberofsmallerprogramsorsubprograms.Eachsubprogramspecifiesoneormoreactionstobeperformedforthelargerprogram.Suchsubprogramsarecalledfunctions. ANSWER QUESTION 66
  • 68. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisanargument? 68 QUESTION Anargumentisanentityusedtopassdatafromthecallingtoacalledfunction. ANSWER QUESTION 67
  • 69. For the hottest C jobs, please visit www.hirist.com hirist .com WriteaprogramwhichemploysRecursion? 69 QUESTION intfact(intn){returnn>1?n*fact(n–1):1;} ANSWER QUESTION 68
  • 70. For the hottest C jobs, please visit www.hirist.com hirist .com Whatdothe„c‟and„v‟inargcandargvstandfor? 70 QUESTION Thecinargc(argumentcount)standsforthenumberofcommandlineargumenttheprogramisinvokedwithandvinargv(argumentvector)isapointertoanarrayofcharacterstringthatcontainthearguments. ANSWER QUESTION 69
  • 71. For the hottest C jobs, please visit www.hirist.com hirist .com WhatareCidentifiers? 71 QUESTION Thesearenamesgiventovariousprogrammingelementsuchasvariables,function,arrays.Itisacombinationofletter,digitandunderscore.Itshouldbeginwithletter.Backspaceisnotallowed. ANSWER QUESTION 70
  • 72. For the hottest C jobs, please visit www.hirist.com hirist .com Whatdothefunctionsatoi(),itoa()andgcvt()do? 72 QUESTION atoi()isamacrothatconvertsintegertocharacter. itoa()Itconvertsanintegertostring gcvt()Itconvertsafloatingpointnumbertostring ANSWER QUESTION 71
  • 73. For the hottest C jobs, please visit www.hirist.com hirist .com Howisfopen()used? 73 QUESTION Thefunctionfopen()returnsafilepointer.Henceafilepointerisdeclaredanditisassignedas FILE*fp; fp=fopen(filename,mode); filenameisastringrepresentingthenameofthefileandthemoderepresents: “r”forreadoperation “w”forwriteoperation “a”forappendoperation “r+”,”w+”,”a+”forupdateoperation ANSWER QUESTION 72
  • 74. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisthepurposeofftell? 74 QUESTION Thefunctionftell()isusedtogetthecurrentfilerepresentedbythefilepointer. ftell(fp); returnsalongintegervaluerepresentingthecurrentfilepositionofthefilepointedbythe filepointerfp.Ifanerroroccurs,-1isreturned. ANSWER QUESTION 73
  • 75. For the hottest C jobs, please visit www.hirist.com hirist .com Discussonpointerarithmetic? 75 QUESTION 1.Assignmentofpointerstothesametypeofpointers. 2.Addingorsubtractingapointerandaninteger. 3.Subtractingorcomparingtwopointer. 4.Incrementingordecrementingthepointerspointingtotheelementsofanarray.Whenapointertoanintegerisincrementedbyone,theaddressisincrementedbytwo.Itisdoneautomaticallybythecompiler. 5.Assigningthevalue0tothepointervariableandcomparing0withthepointer.Thepointerhavingaddress0pointstonowhereatall. ANSWER QUESTION 74
  • 76. For the hottest C jobs, please visit www.hirist.com hirist .com Whatistheinvalidpointerarithmetic? 76 QUESTION i)adding,multiplyinganddividingtwopointers. ii)Shiftingormaskingpointer. iii)Additionoffloatordoubletopointer. iv)Assignmentofapointerofonetypetoapointerofanothertype? ANSWER QUESTION 75
  • 77. For the hottest C jobs, please visit www.hirist.com hirist .com Canweinitializeunions? 77QUESTION ANSIStandardCallowsaninitializerforthefirstmemberofaunion.Thereisnostandardwayofinitializinganyothermember(nor,underapre-ANSIcompiler,istheregenerallyanywayofinitializingaunionatall). ANSWER QUESTION 76
  • 78. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisOutputoffollowingcsnippet? intmain(){ char*s="Abhas"; printf("%s",s+2); getch(); } 78 QUESTION Has.Explanation:Intheaboveprogramroleof%sistodisplaythestringwhoseaddressispassedasanargument.Thisishowastandardprintfstatementworksinclanguage.Nowsincewehavepasseds+2asanargumentthereforefirstvalueofthisexpressionisevaluated.Here„s‟wouldrefertoaddressoffirstcharacterinstring„s‟.Nowprintfwouldgetaddressofthirdcharacter(addressoffirstcharacter+2)asargumentsoitwilldisplaythestringstartingfromthirdposition.Henceoutputwouldbe„has‟. ANSWER QUESTION 77
  • 79. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisdifferencebetween.comprogramand.exeprogram? 79 QUESTION Both.comand.exeprogramareexecutableprogrambut.comprogramexecutesfasterthan.exeprogram.Alldriversare.comprogram..comfilehashigherpreferencethan.exe. ANSWER QUESTION 78
  • 80. For the hottest C jobs, please visit www.hirist.com hirist .com DescribeturbocCompiler? 80 QUESTION TurbocisanIDEprogramminglanguagecreatedbyBorland.TurboC3.0isbasedonMSDOSoperationsystem.Itisoneofthemostpopularccompilers.Ituses8086microprocessorwhichis16bitmicroprocessor.Ithas20addressbusesand16databus.Itswordlengthistwobyte. ANSWER QUESTION 79
  • 81. For the hottest C jobs, please visit www.hirist.com hirist .com Outoffgets()andgets()whichfunctionissafetouseandwhy? 81 QUESTION Fgets()issaferthangets(),becausewecanspecifyamaximuminputlength.Neitheroneiscompletelysafe, becausethecompilercan‟tprovethatprogrammerwon‟toverflowthebufferhepasstofgets(). ANSWER QUESTION 80
  • 82. For the hottest C jobs, please visit www.hirist.com hirist .com Differentiatebetweena“forloop”anda“whileloop”? 82 QUESTION Forexecutingasetofstatementsfixednumberoftimesweuse“forloop”whilewhenthenumberofiterationstobeperformedisnotknowninadvanceweuse“whileloop”. ANSWER QUESTION 81
  • 83. For the hottest C jobs, please visit www.hirist.com hirist .com Isthereabuilt-infunctioninCthatcanbeusedforsortingdata? 83 QUESTION Yes,usetheqsort()function.Itisalsopossibletocreateuserdefinedfunctionsforsorting,suchasthosebasedontheballoonsortandbubblesortalgorithm. ANSWER QUESTION 82
  • 84. For the hottest C jobs, please visit www.hirist.com hirist .com Whataretheadvantagesanddisadvantagesofaheap? 84 QUESTION Storingdataontheheapisslowerthanitwouldtakewhenusingthestack.However,themainadvantageofusingtheheapisitsflexibility.That‟sbecausememoryinthisstructurecanbeallocatedandremoveinanyparticularorder.Slownessintheheapcanbecompensatedifanalgorithmwaswelldesignedandimplemented. ANSWER QUESTION 83
  • 85. For the hottest C jobs, please visit www.hirist.com hirist .com HowdoyouconvertstringstonumbersinC? 85 QUESTION Youcanwriteyouownfunctionstodostringtonumberconversions,orinsteaduseC‟sbuiltinfunctions.Youcanuseatoftoconverttoafloatingpointvalue,atoitoconverttoanintegervalue,andatoltoconverttoalongintegervalue. ANSWER QUESTION 84
  • 86. For the hottest C jobs, please visit www.hirist.com hirist .com Createasimplecodefragmentthatwillswapthevaluesoftwovariablesnum1andnum2. 86 QUESTION inttemp; temp=num1; num1=num2; num2=temp; ANSWER QUESTION 85
  • 87. For the hottest C jobs, please visit www.hirist.com hirist .com Whatistheuseofasemicolon(;)attheendofeveryprogramstatement? 87 QUESTION Ithastodowiththeparsingprocessandcompilationofthecode.Asemicolonactsasadelimiter,sothatthecompilerknowswhereeachstatementends,andcanproceedtodividethestatementintosmallerelementsforsyntaxchecking. ANSWER QUESTION 86
  • 88. For the hottest C jobs, please visit www.hirist.com hirist .com Whatdoesthecharacters“r”and“w”meanwhenwritingprogramsthatwillmakeuseoffiles? 88 QUESTION “r”means“read”andwillopenafileasinputwhereindataistoberetrieved.“w”means“write”,andwillopenafileforoutput.Previousdatathatwasstoredonthatfilewillbeerased. ANSWER QUESTION 87
  • 89. For the hottest C jobs, please visit www.hirist.com hirist .com WhichfunctioninCcanbeusedtoappendastringtoanotherstring? 89 QUESTION Thestrcatfunction.Ittakestwoparameters,thesourcestringandthestringvaluetobeappendedtothesourcestring. ANSWER QUESTION 88
  • 90. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisthedifferencebetweenfunctionsgetch()andgetche()? 90 QUESTION Bothfunctionswillacceptacharacterinputvaluefromtheuser.Whenusinggetch(),thekeythatwaspressedwillnotappearonthescreen,andisautomaticallycapturedandassignedtoavariable.Whenusinggetche(),thekeythatwaspressedbytheuserwillappearonthescreen,whileatthesametimebeingassignedtoavariable. ANSWER QUESTION 89
  • 91. For the hottest C jobs, please visit www.hirist.com hirist .com Whatdoesthefunctiontoupper()do? 91 QUESTION Itisusedtoconvertanylettertoitsuppercasemode.Toupper()functionprototypeisdeclaredin<ctype.h>.Notethatthisfunctionwillonlyconvertasinglecharacter,andnotanentirestring. ANSWER QUESTION 90
  • 92. For the hottest C jobs, please visit www.hirist.com hirist .com Whatarerun-timeerrors? 92 QUESTION Theseareerrorsthatoccurwhiletheprogramisbeingexecuted.Onecommoninstancewhereinrun-timeerrorscanhappeniswhenyouaretryingtodivideanumberbyzero.Whenrun-timeerrorsoccur,programexecutionwillpause,showingwhichprogramlinecausedtheerror. ANSWER QUESTION 91
  • 93. For the hottest C jobs, please visit www.hirist.com hirist .com Isthisprogramstatementvalid?INT=10.50; 93 QUESTION AssumingthatINTisavariableoftypefloat,thisstatementisvalid.OnemaythinkthatINTisareservedwordandmustnotbeusedforotherpurposes.However,recallthatreservedwordsareexpressinlowercase,sotheCcompilerwillnotinterpretthisasareservedword. ANSWER QUESTION 92
  • 94. For the hottest C jobs, please visit www.hirist.com hirist .com Whatiswrongwiththisprogramstatement?void=10; 94 QUESTION ThewordvoidisareservedwordinClanguage.Youcannotusereservedwordsasauser-definedvariable. ANSWER QUESTION 93
  • 95. For the hottest C jobs, please visit www.hirist.com hirist .com WhatwouldhappentoXinthisexpression:X+=15;(assumingthevalueofXis5) 95 QUESTION X+=15isashortmethodofwritingX=X+15,soiftheinitialvalueofXis5,then5+15=20. ANSWER QUESTION 94
  • 96. For the hottest C jobs, please visit www.hirist.com hirist .com Notallreservedwordsarewritteninlowercase.TRUEorFALSE? 96 QUESTION FALSE.Allreservedwordsmustbewritteninlowercase;otherwisetheCcompilerwouldinterpretthisasunidentifiedandinvalid. ANSWER QUESTION 95
  • 97. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisfloatingpointconstants? 97 QUESTION Floating-pointconstantsarenumberswithdecimalparts.Afloating-pointconstantsconsistsof: Anintegralpart Adecimalpoint Afractionalpart Anexponentpart Anoptionalsuffix ANSWER QUESTION 96
  • 98. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisthedifferencebetweenfreadandfwritefunction? 98 QUESTION Thefread()functionreturnsthenumberofitemsread.Thisvaluemaybelessthancountiftheendofthefileisreachedoranerroroccurs.Thefwrite()functionreturnsthenumberofitemswritten.Thisvaluewillequalcountunlessanerroroccurs. ANSWER QUESTION 97
  • 99. For the hottest C jobs, please visit www.hirist.com hirist .com Whatismeantbyinheritance? 99QUESTION Inheritanceistheprocessbywhichobjectsofoneclassacquirepropertiesofobjectsofanotherclass. ANSWER QUESTION 98
  • 100. For the hottest C jobs, please visit www.hirist.com hirist .com WhatisaternaryoperatorinC? 100 QUESTION PerhapsthemostunusualoperatorinClanguageisonecalledtheconditionalexpressionoperator.UnlikeallotheroperatorsinCwhichareeitherunaryorbinaryoperatorstheconditionalexpressionoperatorisaternaryoperator; thatis,ittakesthreeoperands.Thetwosymbolsthatareusedtodenotethisoperatorarethequestionmark(?) andthecolon(:).Thefirstoperandisplacedbeforethe?,thesecondbetweenthe?andtheandthethirdafterthe:. ANSWER QUESTION 99
  • 101. For the hottest C jobs, please visit www.hirist.com hirist .com Whatisunaryoperator? 101 QUESTION Theoperatorsthatactuponasingleoperandtoproduceanewvalueareknownasunaryoperators. ANSWER QUESTION 100
  • 102. For the hottest C jobs, please visit www.hirist.com hirist .com Resources 102 http://www.fresherventure.net/frequently-asked-c-language-interview-questions- and-answers/ http://www.itechaleart.com/2014/06/top-100-c-interview-qa.html http://placement.freshersworld.com/power-preparation/technical-interview- questions/C-programming-answers-21419 http://career.guru99.com/top-100-c-interview-questions-answers/ http://www.slideshare.net/vineetkumarsaini/top-c-language-interview-questions- and-answer http://www.cquestions.com/2010/10/c-interview-questions-and-answers.html http://placementsindia.blogspot.com/2007/10/basic-c-interview-questions.html https://www.udemy.com/blog/c-programming-questions/ http://crackaninterview.com/c-language-interview-questions/ http://www.cwithabhas.com/2013/09/simple-c-interview-questions-for-mass.html http://www.freejobalert.com/c-interview-questions/2891/
  • 103. www.hirist.com TOP 100 INTERVIEW QUESTIONS & ANSWERS C