Questions and Answers
All Updated 2026
HowBisBCBdifferentBthanBJava?B-BAnswerB-BLower-levelBlanguage
-BCanBofferBmuchBbetterBperformance.
-BExposesBmoreBofBwhat'sBgoingBonBunderneath
WhatBthingsBareBwrittenBinBC?B-BAnswerB-BLinux:BAssemblyBandBC
-BMSBWindows:BAssembly,BC,BandBC++
-BJVM:BAssembly,BC,BandBC++
-BEmbeddedBsystemsB(cars,Bcalculators,Bappliances,Betc.)
-BHighBperformanceBapplicationsB(science/engineering)
CBisB___________.BABprogramBthatBisBaBcollectionBofB____________B(functions).BItBfoc
usesBonBactionsBperformedBbyBtheseB__________.B-
BAnswerBCBisBPROCEDURAL.BABprogramBthatBisBaBcollectionBofBPROCEDURESB(functions
).BItBfocusesBonBactionsBperformedBbyBtheseBPROCEDURES.
WhatBlibraryBisBusedBsinceB1999?B-BAnswerBC99Bstandard
WhatBareBtheBstrengthsBofBC?B-BAnswerB-BWeBcanBdoBthingsBthatBaBhigher-
levelBlanguageBcouldBnot
-BTheBCBprogramsBandBcompilerBcanBbeBtinyBandBfast
-BItBcanBbeButilizedBspecificallyBforBsomeBhardware
WhatBareBtheBweaknessesBofBC?B-BAnswerB-
BItBoffersBveryBlittleBinBprotectionBandBsecurity
,-BItBlacksBsomeBconstructsBforBmanagingBveryBlargeBprojects
WhatBisBtheBcommonBplatform?B-
BAnswerBABsystemBthatBisBtargetedBonBtoBcompileBCBcodeBandBrunBit.BTheBcommonBp
latformBforBNCSUBCSCB230BisBspecific.
-B64-butBIntelBPC
-BUniversityBLinuxBOS
-BgccBcompilerBsuite
IfBIBhaveBaBsourceBfileBnamedBhello.cBhowBwouldBIBcompileBitBonBterminalBregularlyBt
oBtheBexecutableBhello?B-BAnswerBgccB-WallB-std=c99Bhello.cB-oBhello
HowBwouldBIBcallBanBexecutableBnamedBhelloBfromBterminal?B-BAnswerB./hello
WhatBisBtheBdefaultBoutputBfileBifB-oBnameBisBnotBincludedBinBtheBterminal?B-
BAnswerBa.out
WhatBareBtheBbuilt-inBtypesBinBC?B-BAnswerB-Bchar
-Bshort
-Bint
-Blong
-Bfloat
-Bdouble
(byteBandBbooleanBareBnotBbuilt-in)
InBtheBfollowingBexample,BcanBiBbeBreachedBbyBanyBotherBfunctions?BWhy?
doubleBpower(BdoubleBx,BintBpB)B{B
BdoubleBresultB=B1;
,BforB(BintBiB=B0;BiB<Bp;Bi++B)B
BresultB*=Bx;B
BreturnBresult;B
}B-
BAnswerBNo,BdueBtoBfileBscopeBonlyBparametersBpassedBinBcanBbeBkeptBchangedBoutB
ofBaBfunctionBorBaBpointer,BglobalBvariable,BorBallocatedBmemory.
WouldBtheBlinesBsuccessfullyBcompile?
doubleBresult;
resultB=B1;B-
BAnswerBYes,BaBvariableBcanBbeBinitializedBbeforeBitBisBeverBassignedBaBvalue.
WhatBisBwrongBwithBtheBfollowingBlinesBofBcode:
doubleBresult;
resultB+=B1;
resultB=B1;B-BAnswerBResultBisBnotBinitializedBtoBaBvalueBsoBitBwillBfail.
WhatBfunctionBisBfirstBranBwhenBaBCBexecutableBisBcalled?B-BAnswerBmain()
WhatBdoesBmain()BreturnBtoBindicateBprogramBsuccessBandBfailure?B-
BAnswerB0BforBsuccess
AnythingBbutB0BforBfailure.
EXIT_SUCCESSBandBEXIT_FAILUREBareBbothBconstantBfromBwhichBlibrary?B-
BAnswerBTheBstandardBlibrary:Bstdlib.h
HowBdoByouBincludeBnecessaryBheaderBfilesBinByourBCBprogram?B-
BAnswerB#includeB<stdlib.h>
, WhatBisBtheBfileBtypeBofBstdlib.hB-BAnswerBHeaderBfiles
WhatBlibraryBisBnecessaryBforBperformingBinputBandBoutput?B-BAnswerBStandard-
I/OBheader:Bstdio.h
WhatBfunctionBfromBstdlib.hBlet'sByouBexitBtheBprogramBfromBanywhere?B-
BAnswerBvoidBexit(BintBstatusB);
WhatBisBaBstream?B-BAnswerBItBisBaBfileBorBdeviceBweBcanBreadBorBwrite.
HowBmanyBstreamsBdoesBaBCBprogramBautomaticallyBstartBwith?BAndBwhatBareBthey?B
-BAnswerBThereBareB3BstreamsBautomaticallyBstartedBinBaBCBprogram.BTheyBare:
-BStandardBinputB(inputBtypedBatBtheBterminal)
-BStandardBoutputB(outputBtoBtheBterminal)
-BStandardBerrorB(moreBoutputBtoBtheBterminal)
HowBwouldBIBredirectBaBstreamBforBtheBexecutableBhelloBwithBtheBinputBfileBofBin.txtB
andBhaveBtheBresultsBgoBtoBtheBout.txtBallBinBtheBterminalBwhenBtheBexecutableBisBca
lled?B-BAnswerBhelloB<Bin.txtB>Bout.txt
WhatBdoesBgetchar()BfromBstdio.hBdo?B-
BAnswerBItBgetsBtheBnextBcharBfromBtheBinputBstream.
WhatBdataBtypeBdoesBtheBgetchar()BfunctionBreturn?B-
BAnswerBint,BitBreturnsBtheBcodeBofBtheBnextBcharacterBreadB(rangesBfromB0BtoB255)B
andBifBitBreachesBtheBendBofBtheBfile,BitBoutputsB-1BforBEndBOfBFileB(EOF)
HowBmanyBbitsBareBinBaBbyte?B-BAnswerB8