├── 19 ├── 49 ├── 1.BAK ├── 1.C ├── 1.CPP ├── 10.BAK ├── 10.C ├── 100.BAK ├── 100.C ├── 101.BAK ├── 101.C ├── 102.BAK ├── 102.C ├── 103.BAK ├── 103.C ├── 104.BAK ├── 104.C ├── 105.C ├── 106.BAK ├── 106.C ├── 10B2.CPP ├── 10B6.CPP ├── 10BC2.CPP ├── 10TO11.CPP ├── 11.BAK ├── 11.C ├── 111.C ├── 12.BAK ├── 12.C ├── 12.CPP ├── 123.CPP ├── 123.txt ├── 13.BAK ├── 13.C ├── 13.CPP ├── 14.BAK ├── 14.C ├── 15.BAK ├── 15.C ├── 16.BAK ├── 16.C ├── 17.BAK ├── 17.C ├── 18.BAK ├── 18.C ├── 19.C ├── 1LAR.CPP ├── 2.BAK ├── 2.C ├── 2.CPP ├── 20.BAK ├── 20.C ├── 21.C ├── 22.BAK ├── 22.C ├── 23.BAK ├── 23.C ├── 24.C ├── 25.BAK ├── 25.C ├── 26.C ├── 27.BAK ├── 27.C ├── 28.BAK ├── 28.C ├── 29.C ├── 3.BAK ├── 3.C ├── 3.CPP ├── 30.BAK ├── 30.C ├── 32.C ├── 33.C ├── 34.BAK ├── 34.C ├── 35.BAK ├── 35.C ├── 36.BAK ├── 36.C ├── 37.BAK ├── 37.C ├── 38.BAK ├── 38.C ├── 39.BAK ├── 39.C ├── 4.BAK ├── 4.C ├── 4.CPP ├── 40.BAK ├── 40.C ├── 41.BAK ├── 41.C ├── 42.BAK ├── 42.C ├── 43.BAK ├── 43.C ├── 44.BAK ├── 44.C ├── 45.BAK ├── 45.C ├── 46.BAK ├── 46.C ├── 47.BAK ├── 47.C ├── 48.BAK ├── 48.C ├── 49.BAK ├── 49.C ├── 5.BAK ├── 5.C ├── 5.CPP ├── 50.BAK ├── 50.C ├── 501.C ├── 51.BAK ├── 51.C ├── 52.C ├── 53.BAK ├── 53.C ├── 54.BAK ├── 54.C ├── 55.BAK ├── 55.C ├── 56.C ├── 57.BAK ├── 57.C ├── 58.BAK ├── 58.C ├── 59.C ├── 6.BAK ├── 6.C ├── 6.CPP ├── 60.BAK ├── 60.C ├── 61.BAK ├── 61.C ├── 62.C ├── 63.BAK ├── 63.C ├── 64.BAK ├── 64.C ├── 65.BAK ├── 65.C ├── 66.BAK ├── 66.C ├── 67.C ├── 68.BAK ├── 68.C ├── 69.BAK ├── 69.C ├── 7.BAK ├── 7.C ├── 70.BAK ├── 70.C ├── 71.BAK ├── 71.C ├── 72.BAK ├── 72.C ├── 73.BAK ├── 73.C ├── 74.BAK ├── 74.C ├── 75.C ├── 76.BAK ├── 76.C ├── 77.BAK ├── 77.C ├── 78.C ├── 8.BAK ├── 8.C ├── 9.BAK ├── 9.C ├── A.CPP ├── A1.BAK ├── A1.CPP ├── A10.BAK ├── A10.C ├── A10.CPP ├── A11.BAK ├── A11.C ├── A11.CPP ├── A12.BAK ├── A12.C ├── A12.CPP ├── A13.BAK ├── A13.C ├── A13.CPP ├── A14.BAK ├── A14.C ├── A15.BAK ├── A15.C ├── A16.BAK ├── A16.C ├── A17.BAK ├── A17.C ├── A2.BAK ├── A2.CPP ├── A3.BAK ├── A3.CPP ├── A4.BAK ├── A4.CPP ├── A5.BAK ├── A5.CPP ├── A6.BAK ├── A6.C ├── A6.CPP ├── A7.BAK ├── A7.C ├── A7.CPP ├── A8.BAK ├── A8.C ├── A8.CPP ├── A9.BAK ├── A9.C ├── A9.CPP ├── AA1.BAK ├── AA1.C ├── AA2.BAK ├── AA2.C ├── AA20.BAK ├── AA20.C ├── AA3.BAK ├── AA3.C ├── AA4.BAK ├── AA4.C ├── AA5.BAK ├── AA5.C ├── AA7.BAK ├── AA7.C ├── ADD.BAK ├── ADD.CPP ├── ADDRESS.C ├── AMM.BAK ├── AMM.C ├── ANAND.CPP ├── ANU.CPP ├── ANU01.CPP ├── AP.CPP ├── AP1.CPP ├── AP4.CPP ├── AR1.BAK ├── AR1.C ├── AR1.CPP ├── AR2.BAK ├── AR2.C ├── AR3.C ├── AR4.C ├── AR5.C ├── AR6.BAK ├── AR6.C ├── AR7.BAK ├── AR7.C ├── AR8.BAK ├── AR8.C ├── AREA.BAK ├── AREA1.BAK ├── AREACIR.BAK ├── AREACIR.C ├── AREX.BAK ├── AREX.CPP ├── ARIT.BAK ├── ARIT.C ├── ARITH.BAK ├── ARITH.C ├── ARITH.CPP ├── ARITHVAR.BAK ├── ARITHVAR.C ├── ARR.BAK ├── ARR.CPP ├── ARR1.BAK ├── ARR1.CPP ├── ARRAY1.BAK ├── ARRAY1.C ├── ARRAY1.CPP ├── ARRAY11.BAK ├── ARRAY13.BAK ├── ARRCOLRO.BAK ├── ARRCOLRO.CPP ├── ARREX.BAK ├── ARRKEY.BAK ├── ARRKEY.CPP ├── ARRMATRI.CPP ├── ARRMULT.CPP ├── ARRODDEV.BAK ├── ARRODDEV.CPP ├── ARRSUM.BAK ├── ARRSUM.C ├── ARR_1.BAK ├── ARR_1.CPP ├── ARR_SUM.BAK ├── ARS.BAK ├── ARS.C ├── AR_SUM.BAK ├── AS.CPP ├── AS1.C ├── AS2.BAK ├── AS2.C ├── AS3.C ├── AS4.BAK ├── AS4.C ├── B.CPP ├── B1.C ├── B1.CPP ├── B2.C ├── B2.CPP ├── B4.CPP ├── B5.C ├── B5.CPP ├── B6.C ├── B6.CPP ├── B7.C ├── BASU.CPP ├── BASU1.CPP ├── BCA1.BAK ├── BCA1.CPP ├── BHAGYA.CPP ├── BIG.C ├── BIG.CPP ├── BIG1.BAK ├── BIG1.C ├── BIGGEST.BAK ├── BIGGEST.C ├── BIGGEST.CPP ├── BIGGESTF.BAK ├── BIGGESTF.C ├── BINOMIAL.C ├── BIO.BAK ├── BIO.C ├── BIODATA.BAK ├── BIODATA.C ├── BIODATA.CPP ├── BJBH.CPP ├── BLESSE.C ├── BUILTINS.MAK ├── C.BAK ├── C.C ├── C1.C ├── C1.CPP ├── C10.C ├── C2.C ├── CA01.CPP ├── CA02.CPP ├── CA03.CPP ├── CA04.CPP ├── CA07.CPP ├── CA11.CPP ├── CA5.BAK ├── CA5.CPP ├── CA6.CPP ├── CAL_BY_V.BAK ├── CAL_BY_V.CPP ├── CIRCLE.BAK ├── CIRCLE.C ├── CIRCLE.CPP ├── CIRFUN.BAK ├── CIRFUN.CPP ├── CIR_AREA.BAK ├── CIR_AREA.CPP ├── CLASSCAL.BAK ├── CLASSCAL.CPP ├── CLASS_EX.BAK ├── CLASS_EX.CPP ├── CLASS_IL.BAK ├── CLASS_IL.CPP ├── CLOCK.C ├── CLS1.BAK ├── CLS1.CPP ├── CLS10.BAK ├── CLS10.CPP ├── CLS123.BAK ├── CLS123.CPP ├── CLS2.BAK ├── CLS2.CPP ├── CLS3.BAK ├── CLS3.CPP ├── CLS4.BAK ├── CLS4.CPP ├── CLS5.BAK ├── CLS5.CPP ├── CLS7.BAK ├── CLS7.CPP ├── CLSEMP.BAK ├── CLSEMP.CPP ├── CLSNEW1.BAK ├── CLSNEW1.CPP ├── CLSNEW3.BAK ├── CLSNEW3.CPP ├── CLS_ARR.BAK ├── CLS_ARR.CPP ├── CLS_EX.CPP ├── CLS_NEW1.BAK ├── CLS_NEW1.CPP ├── CON-OPER.BAK ├── CON-OPER.C ├── CON2.BAK ├── CON2.C ├── CON3.BAK ├── CON3.C ├── COND1.BAK ├── COND1.C ├── COND1.CPP ├── COND2.BAK ├── COND2.C ├── COND2.CPP ├── COND3.BAK ├── COND3.CPP ├── COND8.BAK ├── COND8.C ├── CONDITIO.BAK ├── CONDITIO.C ├── CONDITIO.CPP ├── CONST3.BAK ├── CONST3.CPP ├── CONSTEX.BAK ├── CONSTEX.CPP ├── CONSTR.BAK ├── CONSTR.CPP ├── CON_MUL.BAK ├── CON_MUL.CPP ├── COPYCONS.BAK ├── COPYCONS.CPP ├── CP1.BAK ├── CP1.C ├── CPP.EXE ├── CV.C ├── D0.BAK ├── D0.C ├── D1.C ├── DEST.BAK ├── DEST.CPP ├── DIV.C ├── DIVBY.C ├── DMSTATME.C ├── DOW.BAK ├── DOW.C ├── DOW.CPP ├── DOWH1.BAK ├── DOWH1.C ├── DOWHILE.BAK ├── DOWHILE.C ├── DOWHILE1.BAK ├── DOWHILE1.C ├── DOWHILE2.BAK ├── DOWHILE2.C ├── DOWHILE2.CPP ├── DOWHILE3.BAK ├── DOWHILE3.C ├── DOWHILEN.BAK ├── DOWHILEN.CPP ├── DOWHILES.BAK ├── DOWHILES.CPP ├── DO_WHILE.BAK ├── DO_WHILE.CPP ├── DPMI16BI.OVL ├── DPMIINST.EXE ├── DPMILOAD.EXE ├── DPMIMEM.DLL ├── DPMIRES.EXE ├── DSWAP.C ├── DWFACT.BAK ├── DWFACT.C ├── EACH6.C ├── EMPLOYEE.BAK ├── EMPLOYEE.CPP ├── EMPLOY~1.BAK ├── EMPLOY~1.CPP ├── EMP_CLAS.BAK ├── EMP_CLAS.CPP ├── EMSTEST.COM ├── EVEN.BAK ├── EVEN.C ├── EVEN.CPP ├── EVENODD.BAK ├── EVENODD.CPP ├── EVENODD1.BAK ├── EVENODD1.CPP ├── EVENSUM.BAK ├── EVENSUM.C ├── EVODD.CPP ├── EX.BAK ├── EX.C ├── EX.CPP ├── EX1.EXE ├── EXAMPLE.BAK ├── EXAMPLE.C ├── EXCEPTIO.BAK ├── EXCEPTIO.CPP ├── EXIT.CPP ├── EXP.BAK ├── EXP.C ├── EXP.CPP ├── EXPR.CPP ├── F1.BAK ├── F1.C ├── F1.CPP ├── F11.BAK ├── F11.C ├── F12.C ├── F12.CPP ├── F13.C ├── F14.C ├── F15.BAK ├── F15.C ├── F2.BAK ├── F2.C ├── F2.CPP ├── F3.BAK ├── F3.C ├── F3.CPP ├── F4.BAK ├── F4.C ├── F4.CPP ├── F5.BAK ├── F5.C ├── F5.CPP ├── F6.BAK ├── F6.C ├── F6.CPP ├── F7.C ├── F7.CPP ├── F8.C ├── F8.CPP ├── FA1.BAK ├── FA1.C ├── FA2.C ├── FACT.BAK ├── FACT.C ├── FACT.CPP ├── FACTORIA.BAK ├── FACTORIA.CPP ├── FASSIN.BAK ├── FASSIN.C ├── FC1.BAK ├── FC1.CPP ├── FC2.BAK ├── FC2.CPP ├── FC3.BAK ├── FC3.CPP ├── FCAT1.BAK ├── FCAT1.CPP ├── FCAT2.BAK ├── FCAT2.CPP ├── FCAT3.BAK ├── FCAT3.CPP ├── FIB.BAK ├── FIB.C ├── FILE1.BAK ├── FILE1.C ├── FILE1.CPP ├── FILE10.BAK ├── FILE10.C ├── FILE10.CPP ├── FILE11.BAK ├── FILE11.CPP ├── FILE12.CPP ├── FILE13.CPP ├── FILE2.BAK ├── FILE2.CPP ├── FILE3.CPP ├── FILE4.BAK ├── FILE4.CPP ├── FILE5.BAK ├── FILE5.C ├── FILE5.CPP ├── FILE6.BAK ├── FILE6.CPP ├── FILE7.BAK ├── FILE7.CPP ├── FILE8.BAK ├── FILE8.CPP ├── FILE9.CPP ├── FIRST.BAK ├── FIRST.CPP ├── FN.BAK ├── FN.CPP ├── FN1.BAK ├── FN1.C ├── FN2.BAK ├── FN2.C ├── FN3.BAK ├── FN3.C ├── FN4.BAK ├── FN4.C ├── FN5.BAK ├── FN5.C ├── FN6.BAK ├── FN6.C ├── FN7.BAK ├── FN7.C ├── FN8.BAK ├── FN8.C ├── FNOVERLA.BAK ├── FNOVERLA.CPP ├── FOR.C ├── FOR1.BAK ├── FOR1.C ├── FOR1.CPP ├── FOR10.BAK ├── FOR10.CPP ├── FOR2.BAK ├── FOR2.C ├── FOR2.CPP ├── FOR3.BAK ├── FOR3.CPP ├── FOR4.BAK ├── FOR4.CPP ├── FOR5.BAK ├── FOR5.CPP ├── FOR6.BAK ├── FOR6.CPP ├── FOR7.BAK ├── FOR7.CPP ├── FOR8.BAK ├── FOR8.CPP ├── FOR9.BAK ├── FOR9.CPP ├── FOREX.BAK ├── FOREX.C ├── FORLOOP.C ├── FORTABLE.BAK ├── FORTABLE.C ├── FP1.C ├── FP10.C ├── FP2.C ├── FP3.C ├── FP4.C ├── FP5.C ├── FP6.C ├── FP7.C ├── FP8.C ├── FP9.C ├── FR.BAK ├── FR.CPP ├── FR1.C ├── FR2.C ├── FR3.BAK ├── FR3.C ├── FR4.BAK ├── FR4.C ├── FRIEND.BAK ├── FRIEND.CPP ├── FRIEND3.BAK ├── FRIEND3.CPP ├── FRND.BAK ├── FRND.CPP ├── FRND1.BAK ├── FRND1.CPP ├── FUN.BAK ├── FUN.CPP ├── FUN1.BAK ├── FUN1.C ├── FUN1.CPP ├── FUN10.BAK ├── FUN10.C ├── FUN11.C ├── FUN12.BAK ├── FUN12.C ├── FUN2.BAK ├── FUN2.C ├── FUN20.C ├── FUN3.BAK ├── FUN3.C ├── FUN4.BAK ├── FUN4.C ├── FUN5.BAK ├── FUN5.C ├── FUN6.BAK ├── FUN6.C ├── FUN7.BAK ├── FUN7.C ├── FUN8.BAK ├── FUN8.C ├── FUN9.BAK ├── FUN9.C ├── FUNC.BAK ├── FUNC.CPP ├── FUNCT2.BAK ├── FUNCT2.C ├── FUNCTION.BAK ├── FUNCTION.C ├── FUNCTION.CPP ├── FUNEX.BAK ├── FUNEX.CPP ├── FUNO.BAK ├── FUNO.CPP ├── FUNO1.BAK ├── FUNO1.CPP ├── FUNOVE.BAK ├── FUNOVE.CPP ├── FUNP1.BAK ├── FUNP1.C ├── FUNPR2.BAK ├── FUNPR2.C ├── FUNPR3.BAK ├── FUNPR3.C ├── FUN_ADD.BAK ├── FUN_ADD.C ├── FUN_CAL.BAK ├── FUN_CAL.CPP ├── FUN_CALL.BAK ├── FUN_CALL.C ├── FUN_CAT1.C ├── FUN_CAT2.BAK ├── FUN_CAT2.C ├── FUN_CAT3.BAK ├── FUN_CAT3.C ├── FUN_CAT4.BAK ├── FUN_CAT4.C ├── FUN_EX.BAK ├── FUN_EX.CPP ├── FUN_SWAP.BAK ├── FUN_SWAP.C ├── F_C1.BAK ├── F_C1.C ├── F_CAT2.BAK ├── F_CAT2.CPP ├── F_CAT3.BAK ├── F_CAT3.CPP ├── F_CAT4.BAK ├── F_CAT4.CPP ├── F_OVERLO.BAK ├── F_OVERLO.CPP ├── G.CPP ├── G1.C ├── GANESH1.CPP ├── GANESH2.CPP ├── GH.C ├── GRADE.BAK ├── GRADE.C ├── GRADES.C ├── GREP.COM ├── GREP2MSG.EXE ├── H.CPP ├── HAR.C ├── HAR1.C ├── HAR4.C ├── HELLO.C ├── HHHHSSS.BAK ├── HHHHSSS.C ├── HIERARCH.BAK ├── HIERARCH.CPP ├── HYBRID_I.BAK ├── HYBRID_I.CPP ├── IF.C ├── IFELSE1.BAK ├── IFELSE1.C ├── IFELSE1.CPP ├── IFELSE4.CPP ├── IFELSE5.BAK ├── IFELSE5.C ├── IFELSE8.BAK ├── IFELSE8.C ├── IFFF.BAK ├── IFFF.C ├── IF_ELSE.BAK ├── IF_ELSE.CPP ├── IF_ELSE2.BAK ├── IF_ELSE2.C ├── IF_ELSE2.CPP ├── IF_RESUL.BAK ├── IF_RESUL.C ├── INC.C ├── INCRE.C ├── IN_LINE.BAK ├── IN_LINE.CPP ├── IN_LINE1.BAK ├── IN_LINE1.CPP ├── IN_LINE2.BAK ├── IN_LINE2.CPP ├── IN_LINE3.CPP ├── IN_LINE4.CPP ├── ISALPHA.C ├── J.CPP ├── JAN1.BAK ├── JAN1.C ├── JAN2.BAK ├── JAN2.C ├── JAN3.BAK ├── JAN3.C ├── JAN4.C ├── JAN5.BAK ├── JAN5.C ├── JAN6.BAK ├── JAN6.C ├── JAN7.C ├── JAN8.BAK ├── JAN8.C ├── JAN9.BAK ├── JAN9.C ├── JP4.C ├── K.BAK ├── K.C ├── K.CPP ├── K1.BAK ├── K1.C ├── K1.CPP ├── K2.BAK ├── K2.C ├── K2.CPP ├── K3.C ├── K3.CPP ├── K4.BAK ├── K4.C ├── K4.CPP ├── K5.C ├── K5.CPP ├── K6.C ├── K6.CPP ├── K7.C ├── K7.CPP ├── K8.C ├── K8.CPP ├── K9.BAK ├── K9.C ├── KAVYA.C ├── KEO1.C ├── KEO1.CPP ├── KKKK.CPP ├── KS.C ├── L.BAK ├── L.CPP ├── L1.BAK ├── L1.C ├── L2.BAK ├── L2.C ├── LADDER.BAK ├── LADDER.C ├── LADDER10.BAK ├── LADDER10.C ├── LADDER10.CPP ├── LADDER2.BAK ├── LADDER2.C ├── LADDER4.BAK ├── LADDER4.C ├── LADDERNE.BAK ├── LADDERNE.CPP ├── LADDER_I.BAK ├── LADDER_I.CPP ├── LADD_IF.BAK ├── LADD_IF.CPP ├── LADIF1.BAK ├── LADIF1.C ├── LAR1.CPP ├── LARGE2.C ├── LEAP1.BAK ├── LEAP1.C ├── LEAPY.BAK ├── LEAPY.C ├── LEAPYEAR.BAK ├── LEAPYEAR.CPP ├── LOOP1.BAK ├── LOOP1.C ├── LOOP1.CPP ├── LOOP10.BAK ├── LOOP10.C ├── LOOP2.BAK ├── LOOP2.CPP ├── LOOP3.BAK ├── LOOP3.CPP ├── LOOP4.BAK ├── LOOP4.CPP ├── LOOP5.BAK ├── LOOP5.CPP ├── LP.BAK ├── LP.CPP ├── LP1.C ├── LP1.CPP ├── LP10.BAK ├── LP10.C ├── LP11.BAK ├── LP11.C ├── LP12.C ├── LP13.BAK ├── LP13.C ├── LP2.BAK ├── LP2.C ├── LP3.BAK ├── LP3.C ├── LP4.BAK ├── LP4.C ├── LP5.BAK ├── LP5.C ├── LP6.BAK ├── LP6.C ├── M.BAK ├── M.C ├── M.CPP ├── M1.BAK ├── M1.C ├── M1.CPP ├── M10.BAK ├── M10.C ├── M10.CPP ├── M11.BAK ├── M11.C ├── M11.CPP ├── M12.BAK ├── M12.C ├── M12.CPP ├── M13.BAK ├── M13.C ├── M13.CPP ├── M14.BAK ├── M14.C ├── M14.CPP ├── M15.BAK ├── M15.C ├── M15.CPP ├── M16.BAK ├── M16.C ├── M16.CPP ├── M17.BAK ├── M17.C ├── M17.CPP ├── M18.BAK ├── M18.C ├── M18.CPP ├── M19.BAK ├── M19.C ├── M19.CPP ├── M2.BAK ├── M2.C ├── M2.CPP ├── M20.BAK ├── M20.C ├── M20.CPP ├── M21.BAK ├── M21.C ├── M21.CPP ├── M22.BAK ├── M22.C ├── M22.CPP ├── M23.BAK ├── M23.C ├── M23.CPP ├── M24.BAK ├── M24.C ├── M24.CPP ├── M25.BAK ├── M25.C ├── M25.CPP ├── M26.BAK ├── M26.C ├── M26.CPP ├── M27 ├── M27.BAK ├── M27.C ├── M27.CPP ├── M28.BAK ├── M28.C ├── M28.CPP ├── M29.BAK ├── M29.C ├── M29.CPP ├── M3.BAK ├── M3.C ├── M3.CPP ├── M30.BAK ├── M30.C ├── M30.CPP ├── M31.BAK ├── M31.C ├── M31.CPP ├── M32.BAK ├── M32.C ├── M32.CPP ├── M33.BAK ├── M33.C ├── M33.CPP ├── M34.BAK ├── M34.C ├── M34.CPP ├── M35.BAK ├── M35.C ├── M35.CPP ├── M36.BAK ├── M36.C ├── M37.BAK ├── M37.C ├── M38.BAK ├── M38.C ├── M39.BAK ├── M39.C ├── M4.BAK ├── M4.C ├── M4.CPP ├── M40.BAK ├── M40.C ├── M41.BAK ├── M41.C ├── M41.CPP ├── M42.BAK ├── M42.C ├── M42.CPP ├── M43.BAK ├── M43.C ├── M43.CPP ├── M44.BAK ├── M44.C ├── M44.CPP ├── M45.BAK ├── M45.C ├── M45.CPP ├── M46.BAK ├── M46.C ├── M46.CPP ├── M47.C ├── M47.CPP ├── M48.BAK ├── M48.C ├── M48.CPP ├── M49.BAK ├── M49.C ├── M49.CPP ├── M5 ├── M5.BAK ├── M5.C ├── M5.CPP ├── M50.BAK ├── M50.C ├── M50.CPP ├── M6.BAK ├── M6.C ├── M6.CPP ├── M7.BAK ├── M7.C ├── M7.CPP ├── M8.BAK ├── M8.C ├── M8.CPP ├── M9.BAK ├── M9.C ├── M9.CPP ├── M_SUM_OP.BAK ├── M_SUM_OP.CPP ├── README.md ├── cpp_exp.cpp └── i.CPP /19: -------------------------------------------------------------------------------- 1 | /*prg to find area of a traingle when 3 sides are given*/ 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | float a,b,c,area,s; 8 | clrscr(); 9 | printf("\n Enter three sides"); 10 | scanf("%f%f%f",&a,&b,&c); 11 | s=(a+b+c)/2; 12 | area=sqrt(s*(s-a)*(s-b)*(s-c)); 13 | printf("\n Area of a traingle =%f",area); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /1.BAK: -------------------------------------------------------------------------------- 1 | //prg to disply a simple message. 2 | #include 3 | #include 4 | void main() 5 | { 6 | /*clrscr();*/ 7 | printf("\n Welcome to C programming"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /1.C: -------------------------------------------------------------------------------- 1 | //prg to disply a simple message. 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n Welcome to C programming"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /1.CPP: -------------------------------------------------------------------------------- 1 | // program to print message. 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | int a=5,b=10,sum=0; 8 | sum=a+b; 9 | printf("\nsum:=%d",sum); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /10.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find sum and average of three nums*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,c,sum; 7 | float avg; 8 | clrscr(); 9 | printf("\n Enter three nums"); 10 | scanf("%d%d%d",&a,&b,&c); 11 | sum=a+b+c; 12 | avg=(float)sum/3.0;//type casting 13 | printf("\n sum=%d",sum); 14 | printf("\n average=%f",avg); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /10.C: -------------------------------------------------------------------------------- 1 | /*prg to find sum and average of three nums*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,c,sum; 7 | float avg; 8 | clrscr(); 9 | printf("\n Enter three nums"); 10 | scanf("%d%d%d",&a,&b,&c); 11 | sum=a+b+c; 12 | avg=(float)sum/3.0;//type casting 13 | printf("\nsum=%d",sum); 14 | printf("\naverage=%f",avg); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /100.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to 20 even nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | printf("\n 1 to 20 Even nums area:\n"); 9 | while(i<=40) 10 | { 11 | if(i%2==0) 12 | { 13 | printf("\n \t %d",i); 14 | } 15 | i++; 16 | } 17 | getch(); 18 | } 19 | -------------------------------------------------------------------------------- /101.BAK: -------------------------------------------------------------------------------- 1 | //prg to read a string and print the same 2 | #include 3 | #include 4 | void main() 5 | { 6 | char str[20]; 7 | clrscr(); 8 | printf("\n Enter any string"); 9 | gets(str); 10 | //scanf("%s",str); 11 | printf("\n Entered string is %s",str); 12 | getch(); 13 | } 14 | -------------------------------------------------------------------------------- /101.C: -------------------------------------------------------------------------------- 1 | //prg to read a string and print the same 2 | #include 3 | #include 4 | void main() 5 | { 6 | char str[20]; 7 | clrscr(); 8 | printf("\n Enter any string"); 9 | gets(str); 10 | //scanf("%s",str); 11 | printf("\n Entered string is %s",str); 12 | getch(); 13 | } 14 | -------------------------------------------------------------------------------- /102.BAK: -------------------------------------------------------------------------------- 1 | //prg to reverse a given string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str[20]; 8 | clrscr(); 9 | printf("\n Enter any string"); 10 | gets(str); 11 | strrev(str); 12 | printf("\n Reversed string is %s",str); 13 | getch(); 14 | } 15 | -------------------------------------------------------------------------------- /102.C: -------------------------------------------------------------------------------- 1 | //prg to reverse a given string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str[20]; 8 | clrscr(); 9 | printf("\n Enter any string"); 10 | gets(str); 11 | strrev(str); 12 | printf("\n Reversed string is %s",str); 13 | getch(); 14 | } 15 | -------------------------------------------------------------------------------- /103.BAK: -------------------------------------------------------------------------------- 1 | //prg to find the length of a given string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | int len=0; 8 | char str[20]; 9 | clrscr(); 10 | printf("\n Enter any string"); 11 | gets(str); 12 | len=strlen(str); 13 | printf("\n Length of given string is %s",len); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /103.C: -------------------------------------------------------------------------------- 1 | //prg to find the length of a given string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | int len=0; 8 | char str[20]; 9 | clrscr(); 10 | printf("\n Enter any string"); 11 | gets(str); 12 | len=strlen(str); 13 | printf("\n Length of given string is %d",len); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /104.BAK: -------------------------------------------------------------------------------- 1 | //prg to copy string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str1[20],str2[20]; 8 | clrscr(); 9 | printf("\n Enter any string"); 10 | gets(str1); 11 | strcpy(str2,str1); 12 | printf("\n Given string is %s",str1); 13 | printf("\n Copied string is %s",str2); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /104.C: -------------------------------------------------------------------------------- 1 | //prg to copy string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str1[20],str2[20]; 8 | clrscr(); 9 | printf("\n Enter any string"); 10 | gets(str1); 11 | strcpy(str2,str1); 12 | printf("\n Given string is %s",str1); 13 | printf("\n Copied string is %s",str2); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /105.C: -------------------------------------------------------------------------------- 1 | //prg to convert upper case string to lower case 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str[20]; 8 | clrscr(); 9 | printf("\n Enter any string"); 10 | gets(str); 11 | strlwr(str); 12 | printf("\n Lower case string is %s",str); 13 | strupr(str); 14 | printf("\n Upper case string is %s",str); 15 | 16 | getch(); 17 | } -------------------------------------------------------------------------------- /106.BAK: -------------------------------------------------------------------------------- 1 | //prg to concatenate two string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str1[20],str2[20]; 8 | clrscr(); 9 | printf("\n Enter any string"); 10 | gets(str1); 11 | strcat(str1,str2); 12 | printf("\n Concatenated string is %s",str1); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /106.C: -------------------------------------------------------------------------------- 1 | //prg to concatenate two string 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str1[20],str2[20]; 8 | clrscr(); 9 | printf("\n Enter first string"); 10 | gets(str1); 11 | printf("\n Enter second string"); 12 | gets(str2); 13 | 14 | strcat(str1,str2); 15 | printf("\n Concatenated string is %s",str1); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /10TO11.CPP: -------------------------------------------------------------------------------- 1 | //program to print the message. 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("welcome to c program"); 8 | printf("\nwelcome to c program"); 9 | printf("\nwelcome to c program"); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /11.BAK: -------------------------------------------------------------------------------- 1 | 2 | /*prg to demonstrate increment operator*/ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int i=10,j=20; 8 | clrscr(); 9 | printf("\n Before incrementing i=%d \t j=%d",i,j); 10 | printf("\n After incrementing i=%d",--i); 11 | printf("\n updated i value=%d",i); 12 | printf("\n After incrementing j=%d",--j); 13 | printf("\n updated j value=%d",j); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /11.C: -------------------------------------------------------------------------------- 1 | 2 | /*prg to demonstrate increment operator*/ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int i=10,j=20; 8 | clrscr(); 9 | printf("\n Before incrementing i=%d \t j=%d",i,j); 10 | printf("\n After incrementing i=%d",--i); 11 | printf("\n updated i value=%d",i); 12 | printf("\n After incrementing j=%d",--j); 13 | printf("\n updated j value=%d",j); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /111.C: -------------------------------------------------------------------------------- 1 | /*prg to print Hello message N no of times using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,n; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | while(i<=n) 11 | { 12 | printf("\t Hello"); 13 | i++; 14 | } 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /12.BAK: -------------------------------------------------------------------------------- 1 | /*prg to demonstrate decrement operator*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=10,j=20; 7 | clrscr(); 8 | printf("\n Before decrementing i=%d \t j=%d",i,j); 9 | printf("\n After decrementing i=%d",i--); 10 | printf("\n updated i value=%d",i); 11 | printf("\n j=%d",--j); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /12.C: -------------------------------------------------------------------------------- 1 | /*prg to demonstrate decrement operator*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=10,j=20; 7 | clrscr(); 8 | printf("\n Before decrementing i=%d \t j=%d",i,j); 9 | printf("\n After decrementing i=%d",i--); 10 | printf("\n updated i value=%d",i); 11 | printf("\n j=%d",--j); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /12.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int lar(int ,int ); 4 | void main () 5 | { 6 | int x,y,z; 7 | clrscr(); 8 | cout<<"Enter x,y values"; 9 | cin>>x>>y; 10 | z=lar(x,y); 11 | cout<<"\nLargest of two nu "<b?a:b); 18 | return(c); 19 | } -------------------------------------------------------------------------------- /123.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int *p; 6 | clrscr(); 7 | p=0x00001010; 8 | printf("\n %x",p); 9 | printf("\n %x",p*1); 10 | printf("\n %x",p*2); 11 | getch(); 12 | } 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /13.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find area of a traingle*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float area,b=4,h=5; 7 | clrscr(); 8 | // printf("\n Enter base and height"); 9 | // scanf("%f%f",&b,&h); 10 | area=0.5*b*h; 11 | printf("\n Area of a traingle=%0.2f",area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /13.C: -------------------------------------------------------------------------------- 1 | /*prg to find area of a traingle*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float area,b=4,h=5; 7 | clrscr(); 8 | // printf("\n Enter base and height"); 9 | // scanf("%f%f",&b,&h); 10 | area=0.5*b*h; 11 | printf("\n Area of a traingle=%0.2f",area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /14.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find area of a rectangle*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float area,b=10,l=15; 7 | clrscr(); 8 | //printf("\n enter length and breadth"); 9 | //scanf("%f%f",&l,&b); 10 | area=l*b; 11 | printf("\n area of a rectangle=%0.2f",area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /14.C: -------------------------------------------------------------------------------- 1 | /*prg to find area of a rectangle*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float area,b=10,l=15; 7 | clrscr(); 8 | //printf("\n enter length and breadth"); 9 | //scanf("%f%f",&l,&b); 10 | area=l*b; 11 | printf("\n area of a rectangle=%0.2f",area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /15.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find area of a circle*/ 2 | #include 3 | #include 4 | #define pi 3.142 5 | void main() 6 | { 7 | float area,r=4; 8 | clrscr(); 9 | //printf("\n enter radius:"); 10 | //scanf("%f",&r); 11 | //area=pi*r*r; 12 | area=3.142*r*r; 13 | printf("\n area of a circle=%f",area); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /15.C: -------------------------------------------------------------------------------- 1 | /*prg to find area of a circle*/ 2 | #include 3 | #include 4 | #define pi 3.142 5 | void main() 6 | { 7 | float area,r=4; 8 | clrscr(); 9 | //printf("\n enter radius:"); 10 | //scanf("%f",&r); 11 | //area=pi*r*r; 12 | area=3.142*r*r; 13 | printf("\n area of a circle=%f",area); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /16.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find area of a circle */ 2 | #include 3 | #include 4 | float pi=3.142; 5 | void main() 6 | { 7 | float area,r; 8 | clrscr(); 9 | printf("\n Enter radius"); 10 | scanf("%f",&r); 11 | area=pi*r*r; 12 | printf("\n Area of a circle=%f",area); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /16.C: -------------------------------------------------------------------------------- 1 | /*prg to find area of a circle */ 2 | #include 3 | #include 4 | float pi=3.142; 5 | void main() 6 | { 7 | float area,r; 8 | clrscr(); 9 | printf("\n Enter radius"); 10 | scanf("%f",&r); 11 | area=pi*r*r; 12 | printf("\n Area of a circle=%f",area); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /17.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find simple interest */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float p=5000,t=5,r=3.5,si=0; 7 | clrscr(); 8 | // printf("\n Enter p t r values"); 9 | // scanf("%f%f%f",&p,&t,&r); 10 | si=(p*t*r)/100; 11 | printf("\n simple interest=%f",si); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /17.C: -------------------------------------------------------------------------------- 1 | /*prg to find simple interest */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float p=5000,t=5,r=3.5,si=0; 7 | clrscr(); 8 | // printf("\n Enter p t r values"); 9 | // scanf("%f%f%f",&p,&t,&r); 10 | si=(p*t*r)/100; 11 | printf("\n simple interest=%f",si); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /18.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find biggest of two nums using conditional operator */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | (a>b)? printf("\n %d is big",a): printf("\n %d is big",b); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /18.C: -------------------------------------------------------------------------------- 1 | /*prg to find biggest of two nums using conditional operator */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | (a>b)? printf("\n %d is big",a): printf("\n %d is big",b); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /19.C: -------------------------------------------------------------------------------- 1 | 2 | /*prg to find biggest of two nums using conditional operator */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int a,b,res; 8 | clrscr(); 9 | printf("\n Enter two nums"); 10 | scanf("%d%d",&a,&b); 11 | res=(a>b)? a:b; 12 | printf("\n %d is big",res); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /1LAR.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int lar(int x,int y); 4 | void main() 5 | { 6 | int a,b,c; 7 | clrscr(); 8 | cout<<"Enter 2 nu"; 9 | cin>>a>>b; 10 | c=lar(a,b); 11 | cout<<"largest of 2 numbers ="<y?x:y); 18 | return(z); 19 | } 20 | -------------------------------------------------------------------------------- /2.BAK: -------------------------------------------------------------------------------- 1 | /*prg to disply a simple message */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | // clrscr(); 7 | printf("\n All \n The \n Best"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /2.C: -------------------------------------------------------------------------------- 1 | /*prg to disply a simple message */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n All \n The \n Best"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /20.BAK: -------------------------------------------------------------------------------- 1 | /*prg to check whether given no is even or odd using conditional operator */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | (n%2==0)? printf("\n given no is even no"):printf("\n %d is odd",n); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /20.C: -------------------------------------------------------------------------------- 1 | /*prg to check whether given no is even or odd using conditional operator */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | (n%2==0)? printf("\n %d is a even no",n):printf("\n %d is odd",n); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /21.C: -------------------------------------------------------------------------------- 1 | /*prg to check whether given no is +ve or -ve no using conditional operator */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | (n>0)? printf("\n %d is +ve no",n):printf("\n %d is -ve no",n); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /22.BAK: -------------------------------------------------------------------------------- 1 | /*prg to check whether given year is leap yr or not using conditional operator */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int yr; 7 | clrscr(); 8 | printf("\n Enter any yr:"); 9 | scanf("%d",&yr); 10 | (yr%4==0)? printf("\n %d is leap year",yr):printf("\n %d is not a leap year",yr); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /22.C: -------------------------------------------------------------------------------- 1 | /*prg to check whether given year is leap yr or not using conditional operator */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int yr; 7 | clrscr(); 8 | printf("\n Enter any yr"); 9 | scanf("%d",&yr); 10 | (yr%4==0)? printf("\n %d is leap year",yr):printf("\n %d is not a leap year",yr); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /23.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find biggest of two nums using simple if */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | if(a>b) 11 | printf("\n a is big"); 12 | if(a 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | if(a>b) 11 | printf("\n %d is big",a); 12 | if(a 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n Enter any num"); 10 | scanf("%d",&n); 11 | if(n%2==0) 12 | printf("\n %d is a even no",n); 13 | if(n%2!=0) 14 | printf("\n %d is a odd no",n); 15 | 16 | getch(); 17 | } -------------------------------------------------------------------------------- /25.BAK: -------------------------------------------------------------------------------- 1 | /*prg to check whether given no is even or odd using if-else */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | if(n%2==0) 11 | { 12 | printf("\n %d is a even no",n); 13 | } 14 | else 15 | printf("\n %d is a odd no",n); 16 | 17 | getch(); 18 | } -------------------------------------------------------------------------------- /25.C: -------------------------------------------------------------------------------- 1 | /*prg to check whether given no is even or odd using if-else */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | if(n%2==0) 11 | { 12 | printf("\n %d is a even no",n); 13 | } 14 | else 15 | { 16 | printf("\n %d is a odd no",n); 17 | } 18 | getch(); 19 | } -------------------------------------------------------------------------------- /26.C: -------------------------------------------------------------------------------- 1 | 2 | /*prg to check whether given no is +ve or -ve using if-else */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n Enter any num"); 10 | scanf("%d",&n); 11 | if(n>0) 12 | printf("\n %d is a +ve no",n); 13 | else 14 | printf("\n %d is a -ve no",n); 15 | 16 | getch(); 17 | } -------------------------------------------------------------------------------- /3.BAK: -------------------------------------------------------------------------------- 1 | /*prg to disply a simple message */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n all \t the \t best"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /3.C: -------------------------------------------------------------------------------- 1 | /*prg to disply a simple message */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n all \t the \t best"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /37.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to 5 using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | while(i<=5) 9 | { 10 | printf("\n\t %d",i); 11 | i++; 12 | } 13 | getch(); 14 | } 15 | -------------------------------------------------------------------------------- /37.C: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to 5 using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | while(i<=5) 9 | { 10 | printf("\n\t %d",i); 11 | i++; 12 | } 13 | getch(); 14 | } 15 | -------------------------------------------------------------------------------- /38.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print nums 5 to 1 using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=5; 7 | clrscr(); 8 | while(i>=1) 9 | { 10 | printf("\n %d",i); 11 | i--; 12 | } 13 | getch(); 14 | } 15 | -------------------------------------------------------------------------------- /38.C: -------------------------------------------------------------------------------- 1 | /*prg to print nums 5 to 1 using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=5; 7 | clrscr(); 8 | while(i>=1) 9 | { 10 | printf("\n %d",i); 11 | i--; 12 | } 13 | getch(); 14 | } 15 | -------------------------------------------------------------------------------- /39.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to N nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,n; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | while(i<=n) 11 | { 12 | printf("\t %d",i); 13 | i++; 14 | } 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /39.C: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to N nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,n; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | while(i<=n) 11 | { 12 | printf("\t %d",i); 13 | i++; 14 | } 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /40.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to N even nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=2,n; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | printf("\n Even nums are:\n"); 11 | while(i<=n) 12 | { 13 | printf("\t %d",i); 14 | i=i+2; 15 | } 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /40.C: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to N even nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=2,n; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | printf("\n Even nums are:\n"); 11 | while(i<=n) 12 | { 13 | printf("\t %d",i); 14 | i=i+2; 15 | } 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /41.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to N odd nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,n; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | printf("\n 1 to N odd nums are:\n"); 11 | while(i<=n) 12 | { 13 | printf("\n %d",i); 14 | i=i+2; 15 | } 16 | getch(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /41.C: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to N odd nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,n; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | printf("\n 1 to N odd nums are:\n"); 11 | while(i<=n) 12 | { 13 | printf("\n %d",i); 14 | i=i+2; 15 | } 16 | getch(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /43.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find sum of 1 to N nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,n,sum=0; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | while(i<=n) 11 | { 12 | sum=sum+i; 13 | i++; 14 | } 15 | printf("\n sum of 1 to n nums=%d",sum); 16 | getch(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /43.C: -------------------------------------------------------------------------------- 1 | /*prg to find sum of 1 to N nums using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,n,sum=0; 7 | clrscr(); 8 | printf("\n Enter the limit"); 9 | scanf("%d",&n); 10 | while(i<=n) 11 | { 12 | sum=sum+i; 13 | i++; 14 | } 15 | printf("\n sum of 1 to n nums=%d",sum); 16 | getch(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /5.BAK: -------------------------------------------------------------------------------- 1 | 2 | /*prg to find sum of two nums */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int a,b,sum; 8 | clrscr(); 9 | printf("\n Enter two nums"); 10 | scanf("%d%d",&a,&b); 11 | sum=a+b; 12 | printf("\n sum of two nums=%d",&sum); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /5.C: -------------------------------------------------------------------------------- 1 | 2 | /*prg to find sum of two nums */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int a,b,sum; 8 | clrscr(); 9 | printf("\n Enter two nums"); 10 | scanf("%d%d",&a,&b); 11 | sum=a+b; 12 | printf("\n sum of two nums=%d",sum); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /51.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print 1 to 5 using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | printf("\n 1 to 5 nums are:\n"); 9 | do 10 | { 11 | printf("%d\n",i); 12 | i=i+1; 13 | } while(i<=5); 14 | 15 | getch(); 16 | } -------------------------------------------------------------------------------- /51.C: -------------------------------------------------------------------------------- 1 | /*prg to print 1 to 5 using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | printf("\n 1 to 5 nums are:\n"); 9 | do 10 | { 11 | printf("%d\n",i); 12 | i=i+1; 13 | } while(i<=5); 14 | 15 | getch(); 16 | } -------------------------------------------------------------------------------- /52.C: -------------------------------------------------------------------------------- 1 | /*prg to print nos 5 to 1 using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=5; 7 | clrscr(); 8 | printf("\n 5 to 1 nums are:\n"); 9 | do 10 | { 11 | printf("\n %d",i); 12 | i=i-1; 13 | } while(i>=1); 14 | 15 | getch(); 16 | } -------------------------------------------------------------------------------- /53.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print 1 to 20 even nums using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | printf("\n 1 to 20 even nums are:\n"); 9 | do 10 | { 11 | if(i%2==0) 12 | { 13 | printf("\n %d",i); 14 | } 15 | i++; 16 | } while(i<=30); 17 | 18 | getch(); 19 | } -------------------------------------------------------------------------------- /53.C: -------------------------------------------------------------------------------- 1 | /*prg to print 1 to 20 even nums using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | printf("\n 1 to 20 even nums are:\n"); 9 | do 10 | { 11 | if(i%2==0) 12 | { 13 | printf("\n %d",i); 14 | } 15 | i++; 16 | } while(i<=20); 17 | 18 | getch(); 19 | } -------------------------------------------------------------------------------- /54.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print 1 to 20 odd nums using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | printf("\n 1 to 20 odd nums are:\n"); 9 | do 10 | { 11 | printf("\n %d",i); 12 | i=i+2; 13 | } while(i<=20); 14 | 15 | getch(); 16 | } -------------------------------------------------------------------------------- /54.C: -------------------------------------------------------------------------------- 1 | /*prg to print 1 to 20 odd nums using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | printf("\n 1 to 20 odd nums are:\n"); 9 | do 10 | { 11 | printf("\n %d",i); 12 | i=i+2; 13 | } while(i<=20); 14 | 15 | getch(); 16 | } -------------------------------------------------------------------------------- /55.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print 51 to 100 nums which are div by 3and 5 2 | using do while loop*/ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int i=51; 8 | clrscr(); 9 | do 10 | { 11 | if(i%3==0 || i%5==0) 12 | { 13 | printf("\n %d",i); 14 | } 15 | i=i+1; 16 | } while(i<=100); 17 | 18 | getch(); 19 | } -------------------------------------------------------------------------------- /55.C: -------------------------------------------------------------------------------- 1 | /*prg to print 51 to 100 nums which are div by 3and 5 2 | using do while loop*/ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int i=51; 8 | clrscr(); 9 | do 10 | { 11 | if(i%3==0 && i%5==0) 12 | { 13 | printf("\n %d",i); 14 | } 15 | i=i+1; 16 | } while(i<=100); 17 | 18 | getch(); 19 | } -------------------------------------------------------------------------------- /56.C: -------------------------------------------------------------------------------- 1 | /*prg to find factorial of a given num using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,fact=1,n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | do 11 | { 12 | fact=fact*i; 13 | i=i+1; 14 | } while(i<=n); 15 | printf("\n Factorial of a given num=%d",fact); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /57.BAK: -------------------------------------------------------------------------------- 1 | /*prg to find sum of 1 to N nums using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,sum=0,n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | do 11 | { 12 | sum=sum+i; 13 | i=i+1; 14 | } while(i<=n); 15 | printf("\n sum 1 to N nums=%d",sum); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /57.C: -------------------------------------------------------------------------------- 1 | /*prg to find sum of 1 to N nums using do while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,sum=0,n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | do 11 | { 12 | sum=sum+i; 13 | i=i+1; 14 | } while(i<=n); 15 | printf("\n sum 1 to N nums=%d",sum); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /6.BAK: -------------------------------------------------------------------------------- 1 | /*prg to swap two nums using dummy varaible*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,temp; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | printf("\n Before swapping a=%d \t b=%d",a,b); 11 | temp=a; 12 | a=b; 13 | b=temp; 14 | printf("\n After swapping a=%d \t b=%d",a,b); 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /6.C: -------------------------------------------------------------------------------- 1 | /*prg to swap two nums using dummy varaible*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,temp; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | printf("\n Before swapping a=%d \t b=%d",a,b); 11 | temp=a; 12 | a=b; 13 | b=temp; 14 | printf("\n After swapping a=%d \t b=%d",a,b); 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /61.BAK: -------------------------------------------------------------------------------- 1 | 2 | /*prg to print nums 1 to 10 using for loop*/ 3 | #include 4 | #include 5 | int main() 6 | { 7 | int i; 8 | clrscr(); 9 | printf("\n 1 to 10 nums are:\n"); 10 | for(i=1;i<=10;i++) 11 | { 12 | // printf("\t %d",i); 13 | printf("\t Hello"); 14 | } 15 | 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /61.C: -------------------------------------------------------------------------------- 1 | 2 | /*prg to print nums 1 to 10 using for loop*/ 3 | #include 4 | #include 5 | int main() 6 | { 7 | int i; 8 | clrscr(); 9 | printf("\n 1 to 10 nums are:\n"); 10 | for(i=1;i<=10;i++) 11 | { 12 | printf("\t %d",i); 13 | // printf("\t Hello"); 14 | } 15 | 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /62.C: -------------------------------------------------------------------------------- 1 | /*prg to print nums 10 to 1 using for loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i; 7 | clrscr(); 8 | printf("\n 10 to 1 nums are:\n"); 9 | for(i=10;i>=1;i--) 10 | { 11 | printf("\n %d",i); 12 | 13 | } 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /63.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print 51 to 100 nums whcih are divisible by 5 using for loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i; 7 | clrscr(); 8 | 9 | for(i=51;i<=100;i++) 10 | { 11 | if(i%5==0) 12 | { 13 | printf("\n %d",i); 14 | } 15 | } 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /63.C: -------------------------------------------------------------------------------- 1 | /*prg to print 51 to 100 nums whcih are divisible by 5 using for loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i; 7 | clrscr(); 8 | 9 | for(i=55;i<=100;i=i+5) 10 | { 11 | printf("\n %d",i); 12 | 13 | } 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /64.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print hello message 5 times using for loop*/ 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | 10 | for(i=1;i<=5;i++) 11 | { 12 | printf("\n %d.Hello",i); 13 | 14 | } 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /64.C: -------------------------------------------------------------------------------- 1 | /*prg to print hello message 5 times using for loop*/ 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | 10 | for(i=1;i<=5;i++) 11 | { 12 | printf("\n Hello"); 13 | 14 | } 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /65.BAK: -------------------------------------------------------------------------------- 1 | /* prg to find sum of 1 to n nums using for loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i,n,sum=0; 7 | clrscr(); 8 | 9 | printf("\n Enter any num"); 10 | scanf("%d",&n); 11 | for(i=1;i<=n;i++) 12 | { 13 | sum=sum+i; 14 | } 15 | printf("\n sum=%d",sum); 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /65.C: -------------------------------------------------------------------------------- 1 | /* prg to find sum of 1 to n nums using for loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i,n,sum=0; 7 | clrscr(); 8 | 9 | printf("\n Enter any num"); 10 | scanf("%d",&n); 11 | for(i=1;i<=n;i++) 12 | { 13 | sum=sum+i; 14 | } 15 | printf("\n sum=%d",sum); 16 | getch(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /67.C: -------------------------------------------------------------------------------- 1 | /*prg to find factorial of a given num using for loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i,n,fact=1; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | for(i=1;i<=n;i++) 11 | { 12 | fact=fact*i; 13 | } 14 | printf("\n factorial of a given num=%d",fact); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /69.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print below format 2 | * * * 3 | * * * 4 | * * * 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { int r,c; 10 | clrscr(); 11 | printf("\n Printing format \n"); 12 | for(r=1;r<=3;r++) 13 | { 14 | for(c=1;c<=3;c++) 15 | { 16 | printf("\t *"); 17 | } 18 | printf("\n"); 19 | } 20 | getch(); } -------------------------------------------------------------------------------- /69.C: -------------------------------------------------------------------------------- 1 | /*prg to print below format 2 | * * * 3 | * * * 4 | * * * 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { int r,c; 10 | clrscr(); 11 | printf("\n Printing format \n"); 12 | for(r=1;r<=3;r++) 13 | { 14 | for(c=1;c<=3;c++) 15 | { 16 | printf("\t *"); 17 | } 18 | printf("\n"); 19 | } 20 | getch(); } -------------------------------------------------------------------------------- /7.BAK: -------------------------------------------------------------------------------- 1 | /*prg to swap two nums withot using dummy varaible*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | printf("\n Before swapping a=%d \t b=%d",a,b); 11 | a=a+b; 12 | b=a-b; 13 | a=a-b; 14 | printf("\n After swapping a=%d \t b=%d",a,b); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /7.C: -------------------------------------------------------------------------------- 1 | /*prg to swap two nums without using third varaible*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%d%d",&a,&b); 10 | printf("\n Before swapping a=%d \t b=%d",a,b); 11 | a=a+b; 12 | b=a-b; 13 | a=a-b; 14 | printf("\n After swapping a=%d \t b=%d",a,b); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /70.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print below format 2 | 1 2 3 3 | 1 2 3 4 | 1 2 3 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | printf("\n Printing format \n"); 13 | for(r=1;r<=3;r++) 14 | { 15 | for(c=1;c<=3;c++) 16 | { 17 | printf("\t %d",c); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); 22 | } -------------------------------------------------------------------------------- /70.C: -------------------------------------------------------------------------------- 1 | /*prg to print below format 2 | 1 2 3 3 | 1 2 3 4 | 1 2 3 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | printf("\n Printing format \n"); 13 | for(r=1;r<=3;r++) 14 | { 15 | for(c=1;c<=3;c++) 16 | { 17 | printf("\t %d",c); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); 22 | } -------------------------------------------------------------------------------- /71.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print below format 2 | 1 1 1 3 | 2 2 2 4 | 3 3 3 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | printf("\n Printing format \n"); 13 | for(r=1;r<=3;r++) 14 | { 15 | for(c=1;c<=3;c++) 16 | { 17 | printf("\t %d",r); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); 22 | } -------------------------------------------------------------------------------- /71.C: -------------------------------------------------------------------------------- 1 | /*prg to print below format 2 | 1 1 1 3 | 2 2 2 4 | 3 3 3 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | printf("\n Printing format \n"); 13 | for(r=1;r<=3;r++) 14 | { 15 | for(c=1;c<=3;c++) 16 | { 17 | printf("\t %d",r); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); 22 | } -------------------------------------------------------------------------------- /72.BAK: -------------------------------------------------------------------------------- 1 | /* prg to print below format 2 | * 3 | * * 4 | * * * 5 | * * * * 6 | */ 7 | #include 8 | #include 9 | void main() 10 | { 11 | int r,c; 12 | clrscr(); 13 | for(r=1;r<=4;r++) 14 | { 15 | for(c=1;c<=r;c++) 16 | { 17 | printf("\t *"); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); 22 | } -------------------------------------------------------------------------------- /72.C: -------------------------------------------------------------------------------- 1 | /* prg to print below format 2 | * 3 | * * 4 | * * * 5 | * * * * 6 | */ 7 | #include 8 | #include 9 | void main() 10 | { 11 | int r,c; 12 | clrscr(); 13 | printf("\n The pattern is: \n"); 14 | for(r=1;r<=4;r++) 15 | { 16 | for(c=1;c<=r;c++) 17 | { 18 | printf("\t *"); 19 | } 20 | printf("\n"); 21 | } 22 | getch(); 23 | } -------------------------------------------------------------------------------- /73.BAK: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * 4 | * * * 5 | * * * * 6 | */ 7 | #include 8 | #include 9 | void main() 10 | { 11 | int r,c; 12 | clrscr(); 13 | for(r=1;r<=4;r++) 14 | { 15 | for(c=1;c<=r;c++) 16 | { 17 | printf("\t *"); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); 22 | } -------------------------------------------------------------------------------- /74.BAK: -------------------------------------------------------------------------------- 1 | /* 2 | 1 2 3 3 | 1 2 3 4 | 1 2 3 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | for(r=1;r<3;r++) 13 | { 14 | for(c=1;c<3;c++) 15 | { 16 | printf("\t %d",c); 17 | } 18 | printf("\n"); 19 | } 20 | getch(); 21 | } -------------------------------------------------------------------------------- /74.C: -------------------------------------------------------------------------------- 1 | /* 2 | 1 2 3 3 | 1 2 3 4 | 1 2 3 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | for(r=1;r<=3;r++) 13 | { 14 | for(c=1;c<=3;c++) 15 | { 16 | printf("\t %d",c); 17 | } 18 | printf("\n"); 19 | } 20 | getch(); 21 | } -------------------------------------------------------------------------------- /75.C: -------------------------------------------------------------------------------- 1 | /* 2 | 1 1 1 3 | 2 2 2 4 | 3 3 3 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | for(r=1;r<=3;r++) 13 | { 14 | for(c=1;c<=3;c++) 15 | { 16 | printf("\t %d",r); 17 | } 18 | printf("\n"); 19 | } 20 | getch(); 21 | } -------------------------------------------------------------------------------- /76.BAK: -------------------------------------------------------------------------------- 1 | /* 2 | 1 3 | 2 2 4 | 3 3 3 5 | 4 4 4 4 6 | 7 | */ 8 | #include 9 | #include 10 | void main() 11 | { 12 | int r,c; 13 | clrscr(); 14 | for(r=1;r<=4;r++) 15 | { 16 | for(c=1;c<=r;c++) 17 | { 18 | printf("\t %d",r); 19 | } 20 | printf("\n"); 21 | } 22 | getch(); 23 | } -------------------------------------------------------------------------------- /76.C: -------------------------------------------------------------------------------- 1 | /* 2 | 1 3 | 2 2 4 | 3 3 3 5 | 4 4 4 4 6 | */ 7 | #include 8 | #include 9 | void main() 10 | { 11 | int r,c; 12 | clrscr(); 13 | for(r=1;r<=4;r++) 14 | { 15 | for(c=1;c<=r;c++) 16 | { 17 | printf("\t %d",r); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); 22 | } -------------------------------------------------------------------------------- /77.BAK: -------------------------------------------------------------------------------- 1 | /* 2 | 1 3 | 1 2 4 | 1 2 3 5 | 1 2 3 4 6 | 7 | */ 8 | #include 9 | #include 10 | void main() 11 | { 12 | int r,c; 13 | clrscr(); 14 | for(r=1;r<=4;r++) 15 | { 16 | for(c=1;c<=r;c++) 17 | { 18 | printf("\t%d",c); 19 | } 20 | printf("\n"); 21 | } 22 | getch(); 23 | } -------------------------------------------------------------------------------- /77.C: -------------------------------------------------------------------------------- 1 | /* 2 | 1 3 | 1 2 4 | 1 2 3 5 | 1 2 3 4 6 | */ 7 | #include 8 | #include 9 | void main() 10 | { 11 | int r,c; 12 | clrscr(); 13 | for(r=1;r<=4;r++) 14 | { 15 | for(c=1;c<=r;c++) 16 | { 17 | printf("\t%d",c); 18 | } 19 | printf("\n"); 20 | } 21 | getch(); } -------------------------------------------------------------------------------- /78.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/78.C -------------------------------------------------------------------------------- /9.BAK: -------------------------------------------------------------------------------- 1 | /*prg to perform basic arithmetic operations*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%f%f",&a,&b); 10 | printf("\n sum=%f",(a+b)); 11 | printf("\n subtraction=%f",(a-b)); 12 | printf("\n product=%f",(a*b)); 13 | printf("\n division=%f",(a/b)); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /9.C: -------------------------------------------------------------------------------- 1 | /*prg to perform basic arithmetic operations*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float a,b; 7 | clrscr(); 8 | printf("\n Enter two nums"); 9 | scanf("%f%f",&a,&b); 10 | printf("\n sum=%f",(a+b)); 11 | printf("\n subtraction=%f",(a-b)); 12 | printf("\n product=%f",(a*b)); 13 | printf("\n division=%f",(a/b)); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /A.CPP: -------------------------------------------------------------------------------- 1 | /*prg to check whether given no is even or odd using of */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n enter any num"); 9 | scanf("%d", &n); 10 | if (n%2==0) 11 | printf("\n %d is a even no ",n); 12 | else 13 | printf("\n %d is a odd no ",n); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /A1.BAK: -------------------------------------------------------------------------------- 1 | /*prg display a simple message*/ 2 | #include 3 | #include 4 | int main() 5 | { 6 | clrscr(); 7 | printf(" \n All"); 8 | printf(" \n The"); 9 | printf(" \n Best"); 10 | //getch(); 11 | return 0; 12 | } -------------------------------------------------------------------------------- /A1.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | float area,l,b; 6 | clrscr(); 7 | cout<<"enter l & b"; 8 | cin>>l>>b; 9 | area=l*b; 10 | cout<<"\n area of a rectangle="< 3 | #include 4 | int fact(int); 5 | void main() 6 | { 7 | int f,n; 8 | clrscr(); 9 | cout<<"\n enter any num"; 10 | cin>>n; 11 | cout<<"\n factorial of a given num="< 3 | #include 4 | 5 | void main() 6 | { 7 | int a,b,sum; 8 | clrscr(); 9 | cout<<"enter values for a and b"; 10 | cin>>a>>b; 11 | sum=a+b; 12 | cout<<"\n\ta="<>a>>b; 11 | sum=a+b; 12 | cout<<"\n\ta="< 4 | #include 5 | void main() 6 | { 7 | int yr; 8 | clrscr(); 9 | printf("\n enter any year"); 10 | scanf("%d",&yr); 11 | (yr%4==0)?printf("\n leap year");printf("\n not a leap year"); 12 | getch(); 13 | } 14 | -------------------------------------------------------------------------------- /AMM.C: -------------------------------------------------------------------------------- 1 | /* pgm to check whether the given yr is leap year or not using conditional operator*/ 2 | 3 | #include 4 | #include 5 | void main() 6 | { 7 | int yr; 8 | clrscr(); 9 | printf("\n enter any year"); 10 | scanf("%d",&yr); 11 | (yr%4==0)?printf("\n leap year"):printf("\n not a leap year"); 12 | getch(); 13 | } 14 | -------------------------------------------------------------------------------- /ANU.CPP: -------------------------------------------------------------------------------- 1 | //program to print the message 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\welcome to c program"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /AP.CPP: -------------------------------------------------------------------------------- 1 | /* prg to find sum of digit using while loop*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n,temp,digit,sum=0; 7 | clrscr(); 8 | cout<<"\n enter any num"; 9 | cin>>n; 10 | while(n>0) 11 | { 12 | digit=n%10; 13 | sum=sum+digit; 14 | n=n/10; 15 | } 16 | cout<<"\n sum of digits="< 3 | #include 4 | void main() 5 | { 6 | int n,temp,digit,rev=0; 7 | clrscr(); 8 | cout<<"\n enter any num"; 9 | cin>>n; 10 | temp+n; 11 | while(n>0) 12 | { 13 | digit=n%10; 14 | rev=(rev*10)+digit; 15 | n=n/10; 16 | } 17 | cout<<"\n given num is="< 4 | #include 5 | 6 | void main() 7 | { 8 | float r,area; 9 | clrscr(); 10 | r=2.7; 11 | area=3.142*r*r; 12 | printf("\n\trad=%f\n\tarea of circle=%f",r,area); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /AREACIR.BAK: -------------------------------------------------------------------------------- 1 | //area and circumference of the circle 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | double r,area,cir; 9 | clrscr(); 10 | printf("\n\tenter rad of the circle"); 11 | scanf("%lf",&r); 12 | area=3.142*r*r; 13 | cir=2*3.142*r; 14 | printf("\n\trad=%lf\n\tarea of circle=%lf\n\tcircumference=%lf",r,area,cir); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /AREACIR.C: -------------------------------------------------------------------------------- 1 | //area and circumference of the circle 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | double r,area,cir; 9 | clrscr(); 10 | printf("\n\tenter rad of the circle"); 11 | scanf("%lf",&r); 12 | area=3.142*r*r; 13 | cir=2*3.142*r; 14 | printf("\n\trad=%lf\n\tarea of circle=%lf\n\tcircumference=%lf",r,area,cir); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /ARRSUM.BAK: -------------------------------------------------------------------------------- 1 | /*program to accept 2 single dimensional array elements and 2 | find their corresponding sum */ 3 | 4 | #include 5 | -------------------------------------------------------------------------------- /AS.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int a,b,c,x,y; 7 | clrscr(); 8 | cout<<"enter values for a b c x"; 9 | cin>>a>>b>>c>>x; 10 | y=a*x*x+b*x+c; 11 | cout<<"\n\ta="< 2 | #include 3 | float simple(); 4 | float p,t,r,si; 5 | void main() 6 | { 7 | clrscr(); 8 | printf("\nsimple interest=%f",simple()); 9 | getch(); 10 | } 11 | float simple() 12 | { 13 | printf("\nenter values for p t r"); 14 | scanf("%f%f%f",&p,&t,&r); 15 | si=(p*t*r)/100; 16 | return(si); 17 | } 18 | -------------------------------------------------------------------------------- /AS4.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int i,f; 4 | void fact(int ); 5 | 6 | void main() 7 | { 8 | int n; 9 | clrscr(); 10 | printf("\nenter any integer"); 11 | scanf("%d",&n); 12 | fact(n); 13 | getch(); 14 | } 15 | 16 | 17 | void fact(int x) 18 | { 19 | for(i=1;i<=x;i++) 20 | { 21 | f=f*i; 22 | } 23 | printf("\n\tFACTORIAL OF %d is %d",x,f); 24 | } -------------------------------------------------------------------------------- /AS4.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int i,f=1; 4 | void fact(int ); 5 | 6 | void main() 7 | { 8 | int n; 9 | clrscr(); 10 | printf("\nenter any integer"); 11 | scanf("%d",&n); 12 | fact(n); 13 | getch(); 14 | } 15 | 16 | 17 | void fact(int x) 18 | { 19 | for(i=1;i<=x;i++) 20 | { 21 | f=f*i; 22 | } 23 | printf("\n\tFACTORIAL OF %d is %d",x,f); 24 | } -------------------------------------------------------------------------------- /B.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int m; 6 | clrscr(); 7 | cout<<"Enter marks of the student"; 8 | cin>>m; 9 | if(m>=35) 10 | cout<<"\n PASS"; 11 | else 12 | cout<<"\nFAIL"; 13 | getch(); 14 | } -------------------------------------------------------------------------------- /B1.C: -------------------------------------------------------------------------------- 1 | //prg to demonstrate pointer 2 | #include 3 | #include 4 | void main() 5 | { 6 | int x,*p,*p2; 7 | clrscr(); 8 | x=25 9 | p=&x 10 | p2=&p; 11 | printf("\n x value=%d",x); 12 | printf("\n address of x=%d",p); 13 | printf("\n address of p=%d",p2); 14 | printf("\n adderss of p2=%d",&p2); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /B1.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int x,*p,*p2; 6 | clrscr(); 7 | x=25; 8 | p=&x; 9 | p2=&p; 10 | cout<<"\n x value="< 3 | #include 4 | void main() 5 | { 6 | int x,*p,**p2; 7 | clrscr(); 8 | x=25; 9 | p=&x; 10 | p2=&p; 11 | printf("\n x value=%d",x); 12 | printf("\n p value=%d",p); 13 | printf("\n p2 value=%d",p2); 14 | printf("\n *p value=%d",*p); 15 | printf("\n *p2 value=%d",*p2); 16 | printf("\n **p2 value=%d",**p2); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /B5.C: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | void main() 5 | { 6 | int *p; 7 | clrscr(); 8 | p=0x1000; 9 | printf("\n %x",p); 10 | printf("\n %x",p+1); 11 | printf("\n %x",p+2); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /B6.C: -------------------------------------------------------------------------------- 1 | //prg to read 5 nums and print then using pointer varaible 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a[5],i; 7 | clrscr(); 8 | printf("\n entred 5 nos"); 9 | for(i=0;i<=4;i++) 10 | { 11 | scanf("%d",&a[i]; 12 | }printf("\n entred element" 13 | getch(); 14 | } -------------------------------------------------------------------------------- /B7.C: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | void main() 5 | { 6 | int x,y,z,*p1,*p2,*p3; 7 | clrscr(); 8 | p1=&x; 9 | p2=&y; 10 | p3=&z; 11 | *p1=10; 12 | *p2=20; 13 | *p3=(*p1)+(*p2); 14 | printf("\n sum=%d",*p3); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /BCA1.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | class digital_clock 5 | { 6 | time_t t; 7 | public: 8 | void read() 9 | { 10 | time(&t); 11 | } 12 | void display() 13 | { 14 | cout<<"\n\t today date and time is="< 2 | #include 3 | #include 4 | class digital_clock 5 | { 6 | time_t t; 7 | public: 8 | void read() 9 | { 10 | time(&t); 11 | } 12 | void display() 13 | { 14 | cout<<"\n\t today date and time is="< 4 | #include 5 | void main() 6 | { 7 | int a,b; 8 | clrscr(); 9 | printf("\n enter two numbers"); 10 | scanf("%d%d",&a,&b); 11 | printf("\n before swapping a=%d\t b=%d", a,b"); 12 | a=a+b; 13 | b=a-b; 14 | a=a-b; 15 | printf("\n after swapping a=%d\tb=%d",a,b"); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /BIG.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | int a[50],i,n,big; 6 | clrscr(); 7 | printf("\n enter the size of array"); 8 | scanf("%d",&n); 9 | printf("\n enter the %d elements",n); 10 | for(i=0;ibig) 18 | big=a[i]; 19 | } 20 | printf("\n biggest element=%d",big); 21 | getch(); 22 | } -------------------------------------------------------------------------------- /BIG.CPP: -------------------------------------------------------------------------------- 1 | //program to illustrate conditional operator 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,big; 9 | clrscr(); 10 | cout<<"\nenter values for a and b"; 11 | cin>>a>>b; 12 | big=(a>b)?a:b; 13 | cout<<"\n\ta="< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b; 9 | clrscr(); 10 | printf("\nenter values for a and b"); 11 | scanf("%d%d",&a,&b); 12 | if(a>b) 13 | printf("\n\t%d is BIG",a); 14 | else 15 | printf("\n\t%d is BIG",b); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /BIG1.C: -------------------------------------------------------------------------------- 1 | //even and odd numbers 2 | 3 | #include 4 | #include 5 | void main() 6 | { 7 | int a; 8 | clrscr(); 9 | cout<<"\nenter values for a:"; 10 | cin>>a; 11 | if(a%2==0) 12 | cout<<"%d is Even"< 2 | #include 3 | void main() 4 | { 5 | int a,b,c; 6 | clrscr(); 7 | printf(" enter 3 numbers"); 8 | scanf("%d%d%d",&a,&b,&c); 9 | if(a>b) 10 | if(a>c) 11 | printf(" %d is a big",a); 12 | else 13 | printf(" % d is a big",c); 14 | else if(b>c) 15 | printf(" %d is a big",b); 16 | else 17 | printf("%d is a big",c); 18 | getch(); 19 | } 20 | -------------------------------------------------------------------------------- /BINOMIAL.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int a,b,c,x,y; 7 | clrscr(); 8 | printf("Enter any four numbers\n"); 9 | scanf("%d%d%d%d",&a,&b,&c,&x); 10 | y=a*x*x+b*x+c; 11 | printf("y=(ax+b)^2=%d\nfor\ta=%d\n\tb=%d\n\tc=%d\n\tx=%d\n",y,a,b,c,x); 12 | getch(); 13 | } 14 | -------------------------------------------------------------------------------- /BLESSE.C: -------------------------------------------------------------------------------- 1 | //program to check whether the given year is leap year 2 | #include 3 | #include 4 | void main() 5 | { 6 | int year; 7 | clrscr(); 8 | printf("enter the year\n"); 9 | scanf("%d",&year); 10 | if(year%4==0) 11 | printf("\nleap year"); 12 | else 13 | printf("not a leap year\n"); 14 | getch (); 15 | } -------------------------------------------------------------------------------- /C.BAK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/C.BAK -------------------------------------------------------------------------------- /C.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int j=10,k=12; 6 | clrscr(); 7 | if (k>=j) 8 | { 9 | { 10 | k=j; 11 | j=k; 12 | } 13 | } 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /C1.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int j=10,k=12; 6 | clrscr(); 7 | if (k>=j) 8 | { 9 | { 10 | k=j; 11 | j=k; 12 | } 13 | } 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /C1.CPP: -------------------------------------------------------------------------------- 1 | //program to calculate sum of two no's. 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | float a=5,b=10,total,per; 8 | total=a+b; 9 | per=total/2; 10 | printf("\nTotal Number of A And B:=%f",total); 11 | printf("\nTotal Number of Percentage:=%0.2f",per); 12 | getch(); 13 | } 14 | -------------------------------------------------------------------------------- /C10.C: -------------------------------------------------------------------------------- 1 | 2 | // prg to find simple interest 3 | #include 4 | #include 5 | void main() 6 | { 7 | float p,t,r,si; 8 | clrscr(); 9 | cout<<"enter p t r values"; 10 | cin>>p>>t>>r; 11 | si=(p*t*r)/100; 12 | cout<<"\n simple interset="< 3 | #include 4 | void main() 5 | { 6 | float area,b,h; 7 | clrscr(); 8 | printf("\n enter base and height"); 9 | scanf("%f%f",&b,&h); 10 | area=0.5*b*h; 11 | printf("\n area of triangle=%f", area); 12 | getch(); 13 | 14 | } -------------------------------------------------------------------------------- /CA03.CPP: -------------------------------------------------------------------------------- 1 | //program to find area triangle when three sides are given 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | float area, a,b,c,s; 8 | clrscr(); 9 | printf("\n enter values of 3 sides"); 10 | scanf("%f%f%f",&a,&b,&c); 11 | s=(a*b*c)/2; 12 | area =sqrt(s*(s-a)*(s-b)*(s-c)); 13 | printf("\n area of the triangle=%f",area); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /CA04.CPP: -------------------------------------------------------------------------------- 1 | 2 | //program to swap two variable using dummy variable 3 | #include 4 | #include 5 | void main() 6 | { 7 | int a,b, temp; 8 | clrscr(); 9 | printf("\n Enter two numbers"); 10 | scanf("%d%d",&a,&b); 11 | temp=a; 12 | a=b; 13 | b=temp; 14 | printf("\n after swaping a=%d \t b=%d" ,a,b); 15 | getch(); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /CA5.BAK: -------------------------------------------------------------------------------- 1 | //program to find biggest of two numberusing conditional operater 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | printf("\n enter two number"); 8 | scanf("%d%d" ,&a,&b); 9 | (a>b)?printf("\n biggest=%d" ,a): printf("\n biggest =%d",b); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /CA5.CPP: -------------------------------------------------------------------------------- 1 | //program to find biggest of two numberusing conditional operater 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | printf("\n enter two number"); 8 | scanf("%d%d" ,&a,&b); 9 | (a>b)?printf("\n biggest=%d" ,a): printf("\n biggest =%d",b); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /CIRCLE.BAK: -------------------------------------------------------------------------------- 1 | //program to find area of circle 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | float r,area; 8 | clrscr(); 9 | r=6; 10 | area=3.142*r*r; 11 | printf("\n\trad=%f\n\tarea of cirsle=%f",r,area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /CIRCLE.C: -------------------------------------------------------------------------------- 1 | //program to find area of circle 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | float r,area; 8 | clrscr(); 9 | r=6; 10 | area=3.142*r*r; 11 | printf("\n\trad=%f\n\tarea of circle=%f",r,area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /CIRCLE.CPP: -------------------------------------------------------------------------------- 1 | //area and circumference 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | float r,ar,cir; 9 | clrscr(); 10 | cout<<"\n\tenter value for r"; 11 | cin>>r; 12 | ar=3.142*r*r; 13 | cir=2*3.142*r; 14 | cout<<"\n\tr="< 4 | #include 5 | 6 | void area(float r); 7 | void main() 8 | { 9 | float r1; 10 | clrscr(); 11 | printf("enter rad of circle"); 12 | scanf("%f",&r1); 13 | area(r1); 14 | getch(); 15 | } 16 | void area(float r) 17 | { 18 | printf("\narea of circle=%f",(3.142*r*r)); 19 | } -------------------------------------------------------------------------------- /CIRFUN.CPP: -------------------------------------------------------------------------------- 1 | //program to calculate area of circle uing function 2 | 3 | #include 4 | #include 5 | 6 | void area(float r); 7 | void main() 8 | { 9 | float r1; 10 | clrscr(); 11 | printf("\n\tenter rad of circle"); 12 | scanf("%f",&r1); 13 | area(r1); 14 | getch(); 15 | } 16 | void area(float r) 17 | { 18 | printf("\narea of circle=%f",(3.142*r*r)); 19 | } -------------------------------------------------------------------------------- /CIR_AREA.BAK: -------------------------------------------------------------------------------- 1 | //TO FIND AREA and CIRCUMFERENCE OF THE CIRCLE 2 | 3 | #include 4 | #include 5 | #define pi 3.142 6 | 7 | void main() 8 | { 9 | float r,area,cir; 10 | clrscr(); 11 | cout<<"\neneter radious of the circle"; 12 | cin>>r; 13 | area=pi*r*r; 14 | cir=2*pi*r; 15 | cout<<"\n\tRADIOUS="< 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n\tentar 2 integers"); 9 | scanf("%d%d",&a,&b); 10 | (a>b)? printf("\n\t%d is big",a): printf("\n\t%d is big",b); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /CON-OPER.C: -------------------------------------------------------------------------------- 1 | //To find biggest of 2numbers(using conditional operators) 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n\tentar 2 integers"); 9 | scanf("%d%d",&a,&b); 10 | (a>b)? printf("\n\t%d is big",a): printf("\n\t%d is big",b); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /CON2.BAK: -------------------------------------------------------------------------------- 1 | //program to check the entered number is Even or odd 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n\tenter value for n"); 10 | scanf("%d",&n); 11 | (n%2==0)?printf("\n\t%d is EVEN",n):printf("\n\t%d is ODD",n); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /CON2.C: -------------------------------------------------------------------------------- 1 | //program to check the entered number is Even or odd 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n\tenter value for n"); 10 | scanf("%d",&n); 11 | (n%2==0)?printf("\n\t%d is EVEN",n):printf("\n\t%d is ODD",n); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /CON3.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int a,b,c,small; 7 | clrscr(); 8 | printf("\n\tenter values for a b and c"); 9 | scanf("%d%d%d",&a,&b,&c); 10 | small=(a 3 | #include 4 | 5 | void main() 6 | { 7 | int a,b,c,small; 8 | clrscr(); 9 | printf("\n\tenter values for a b and c"); 10 | scanf("%d%d%d",&a,&b,&c); 11 | small=(a 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,big; 9 | clrscr(); 10 | printf("\n\tenter values for a and b"); 11 | scanf("%d%d",&a,&b); 12 | big=(a>b)?a:b; 13 | printf("\n\ta=%d\n\tb=%d\n\tbig=%d",a,b,big); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /COND1.C: -------------------------------------------------------------------------------- 1 | //program to find biggest of 2 numbers using conditional operator 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,big; 9 | clrscr(); 10 | printf("\n\tenter values for a and b"); 11 | scanf("%d%d",&a,&b); 12 | big=(a>b)?a:b; 13 | printf("\n\ta=%d\n\tb=%d\n\tbig=%d",a,b,big); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /COND1.CPP: -------------------------------------------------------------------------------- 1 | //program to find biggest of 2 numbers using conditional operator 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,big; 9 | clrscr(); 10 | printf("\n\tenter values for a and b"); 11 | scanf("%d%d",&a,&b); 12 | big=(a>b)?a:b; 13 | printf("\n\ta=%d\n\tb=%d\n\tbig=%d",a,b,big; 14 | getch(); 15 | } -------------------------------------------------------------------------------- /COND2.BAK: -------------------------------------------------------------------------------- 1 | //check the entered number is divisable by 5 or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int num; 9 | clrscr(); 10 | printf("\nenter any number"); 11 | scanf("%d",&num); 12 | (num%5==0)?printf("\n\n\t%d is DIVISABLE BY 5",num):printf("\n\n\t%dis NOTDIVISABLE BY 5",num); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /COND2.C: -------------------------------------------------------------------------------- 1 | //check the entered number is divisable by 5 or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int num; 9 | clrscr(); 10 | printf("\nenter any number"); 11 | scanf("%d",&num); 12 | (num%5==0)?printf("\n\n\t%d is DIVISABLE BY 5",num):printf("\n\n\t%dis NOTDIVISABLE BY 5",num); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /COND2.CPP: -------------------------------------------------------------------------------- 1 | //program to check person eligible to vote or not using conditional operator 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int age; 9 | clrscr(); 10 | cout<<"\n enter age of the person"; 11 | cin>>age; 12 | (age>=18)?cout<<"ELEIGIBLE TO VOTE":cout<<"NOT ELIGIBLE TO VOTE"; 13 | getch(); 14 | } -------------------------------------------------------------------------------- /COND3.BAK: -------------------------------------------------------------------------------- 1 | //proGram to find biggest of 3 num using conditional operator 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,c,big; 9 | clrscr(); 10 | cout<<"\n enter values for a,b and c"; 11 | cin>>a>>b>>c; 12 | big=(a>b&&a>c)?a:(b>c?b:c); 13 | cout<<"\n\ta="< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,c,big; 9 | clrscr(); 10 | cout<<"\n enter values for a,b and c"; 11 | cin>>a>>b>>c; 12 | big=(a>b&&a>c)?a:(b>c?b:c); 13 | cout<<"\n\ta="< 3 | #include 4 | 5 | void main() 6 | { 7 | int num; 8 | clrscr(); 9 | printf("\nenter any number"); 10 | scanf("%d",&num); 11 | (num%2==0)?printf("\n\n\t%d is EVEN",num):printf("\n\n\t%d is ODD",num); 12 | getch(); 13 | } 14 | -------------------------------------------------------------------------------- /COND8.C: -------------------------------------------------------------------------------- 1 | //check the entered number is even or odd 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int num; 9 | clrscr(); 10 | printf("\nenter any number"); 11 | scanf("%d",&num); 12 | (num%2==0)?printf("\n\n\t%d is EVEN",num):printf("\n\n\t%d is ODD",num); 13 | getch(); 14 | } 15 | -------------------------------------------------------------------------------- /CONDITIO.BAK: -------------------------------------------------------------------------------- 1 | /*check whether the the entered number is positive or nagetive 2 | using conditional operators*/ 3 | 4 | #include 5 | #include 6 | 7 | void main() 8 | { 9 | int n; 10 | clrscr(); 11 | printf("\n\tenter value for n"); 12 | scanf("%d",&n); 13 | (n>0)?printf("\n\t%d is POSITIVE",n):printf("\n\t%d is NAGETIVE",n); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /CONDITIO.C: -------------------------------------------------------------------------------- 1 | /*check whether the the entered number is positive or nagetive 2 | using conditional operators*/ 3 | 4 | #include 5 | #include 6 | 7 | void main() 8 | { 9 | int n; 10 | clrscr(); 11 | printf("\n\tenter value for n"); 12 | scanf("%d",&n); 13 | (n>0)?printf("\n\t%d is POSITIVE",n):printf("\n\t%d is NAGETIVE",n); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /CONDITIO.CPP: -------------------------------------------------------------------------------- 1 | //program to find biggest of 2 num using conditional operator 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,big; 9 | clrscr(); 10 | cout<<"\n enter values for a and b"; 11 | cin>>a>>b; 12 | big=(a>b)?a:b; 13 | cout<<"\n\ta="< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,sum; 9 | clrscr(); 10 | a=10; 11 | b=5; 12 | sum=a+b; 13 | printf("\n\ta=%d",a); 14 | printf("\n\tb=%d",b); 15 | printf("\n\tsum=%d",sum); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /CP1.C: -------------------------------------------------------------------------------- 1 | //program to find sum of 2 numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,sum; 9 | clrscr(); 10 | a=10; 11 | b=5; 12 | sum=a+b; 13 | printf("\n\ta=%d",a); 14 | printf("\n\tb=%d",b); 15 | printf("\n\tsum=%d",sum); 16 | // printf("\n\ta=%d\n\tb=%d\n\tsum=%d",a,b,sum); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /CPP.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/CPP.EXE -------------------------------------------------------------------------------- /D0.BAK: -------------------------------------------------------------------------------- 1 | //program to display odd numbers using do while 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | // printf("\n\tenter value for n"); 11 | // scanf("%d",&n); 12 | i=50; 13 | n=100; 14 | do 15 | { 16 | if(i%5==0) 17 | printf("\t%d\n",i); 18 | i++; 19 | } 20 | while(i<=n); 21 | getch(); 22 | } -------------------------------------------------------------------------------- /D0.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int i,n; 7 | clrscr(); 8 | i=50; 9 | n=100; 10 | printf("\nNUMBERS DIVISABLE BY 5 FROM 50 TO 100 ARE\n"); 11 | do 12 | { 13 | if(i%5==0) 14 | printf("\t%d\n",i); 15 | i++; 16 | } 17 | while(i<=n); 18 | getch(); 19 | } -------------------------------------------------------------------------------- /DIV.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | int i=1; 6 | clrscr(); 7 | 8 | for(i=1;i<=100;i++) 9 | { 10 | if(i%5==0 && i%7==0) 11 | { 12 | printf("\n \t %d",i); 13 | } 14 | } 15 | getch(); 16 | } -------------------------------------------------------------------------------- /DMSTATME.C: -------------------------------------------------------------------------------- 1 | //program to check whether the student is pass 2 | #include 3 | #include 4 | void main () 5 | { 6 | int m; 7 | clrscr(); 8 | printf("enter marks of the student"); 9 | scanf("%d",&m); 10 | if (m>=35) 11 | { 12 | printf("PASS"); 13 | } 14 | getch(); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /DOW.C: -------------------------------------------------------------------------------- 1 | //program to display reverse numbers from n 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i,n; 8 | clrscr(); 9 | printf("\n\tenter final value"); 10 | scanf("%d",&n); 11 | i=1; 12 | do{ 13 | printf("\n\t%d",n); 14 | n--; 15 | }while(i<=n); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /DOWH1.BAK: -------------------------------------------------------------------------------- 1 | //program to display hello message 10 times 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | i=1; 11 | n=10; 12 | do 13 | { 14 | printf("\n\tHELLO"); 15 | i++; 16 | }while(i<=n); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /DOWH1.C: -------------------------------------------------------------------------------- 1 | //program to display hello message 10 times using do while 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | i=1; 11 | n=10; 12 | do 13 | { 14 | printf("\n\tHELLO"); 15 | i++; 16 | }while(i<=n); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /DOWHILE.BAK: -------------------------------------------------------------------------------- 1 | //program to display sum of n natural numbers using do-while 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,sum=0,n; 7 | clrscr(); 8 | printf("\n enter value for n"); 9 | scanf("%d",&n); 10 | do 11 | { 12 | printf("\n\t%d",i); 13 | sum=sum+i; 14 | i++; 15 | }while(i<=n); 16 | printf("\n sum of natural numbers up to %d are=%d",n,sum); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /DOWHILE.C: -------------------------------------------------------------------------------- 1 | //program to display sum of n natural numbers using do-while 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,sum=0,n; 7 | clrscr(); 8 | printf("\n enter value for n"); 9 | scanf("%d",&n); 10 | do 11 | { 12 | printf("\n\t%d",i); 13 | sum=sum+i; 14 | i++; 15 | }while(i<=n); 16 | printf("\n sum of natural numbers up to %d are=%d",n,sum); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /DOWHILE1.BAK: -------------------------------------------------------------------------------- 1 | //program ro dispaly n natural numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\n\tenter final value"); 11 | scanf("%d",&n); 12 | i=1; 13 | do 14 | { 15 | printf("\n\t%d",i); 16 | i++; 17 | }while(i<=n); 18 | getch(); 19 | } 20 | -------------------------------------------------------------------------------- /DOWHILE1.C: -------------------------------------------------------------------------------- 1 | //program ro dispaly n natural numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\n\tenter final value"); 11 | scanf("%d",&n); 12 | 13 | i=1; 14 | do 15 | { 16 | printf("\n\t%d",i); 17 | i++; 18 | }while(i<=n); 19 | getch(); 20 | } 21 | -------------------------------------------------------------------------------- /DOWHILE2.BAK: -------------------------------------------------------------------------------- 1 | //prog to display product of n natural numbers 2 | #include 3 | #include 4 | void main() 5 | 6 | { 7 | int i,n,p=1; 8 | clrscr(); 9 | cout<<"\nenter final value"; 10 | cin>>n; 11 | i=1; 12 | do 13 | { 14 | cout<<"\t\t"<>n; 11 | i=1; 12 | do 13 | { 14 | cout<<"\t\t"< 3 | #include 4 | 5 | void main() 6 | { 7 | int i,n; 8 | clrscr(); 9 | i=50; 10 | n=100; 11 | printf("\nEVEN NUMBERS FROM 50 TO 100 ARE\n"); 12 | do 13 | { 14 | printf("\t%d",i); 15 | i=i+2; 16 | }while(i<=n); 17 | getch(); 18 | } 19 | -------------------------------------------------------------------------------- /DO_WHILE.BAK: -------------------------------------------------------------------------------- 1 | //product of odd numbers up to n 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | long int i,n,p=1; 8 | clrscr(); 9 | cout<<"\n\nenter final value"; 10 | cin>>n; 11 | i=1; 12 | do 13 | { 14 | cout<<"\n\t"<>n; 11 | i=1; 12 | do 13 | { 14 | cout<<"\n\t"< 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,fact=1; 9 | clrscr(); 10 | printf("\n\tenter any integer to calculate factorial"); 11 | scanf("%d",&n); 12 | i=1; 13 | do 14 | { 15 | fact=fact*i; 16 | i++; 17 | }while(i<=n); 18 | getch(); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /EMSTEST.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/EMSTEST.COM -------------------------------------------------------------------------------- /EVEN.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n\tenter value for n"); 9 | scanf("%d",&n); 10 | if(n%2==0) 11 | printf("\n\t%d is EVEN",n); 12 | else 13 | printf("\n\t%d is ODD",n); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /EVEN.C: -------------------------------------------------------------------------------- 1 | //program to check whether the entered number is even or odd 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n\tenter value for n"); 10 | scanf("%d",&n); 11 | if(n%2==0) 12 | printf("\n\t%d is EVEN",n); 13 | else 14 | printf("\n\t%d is ODD",n); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /EVENSUM.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int i,n,sum=0; 7 | clrscr(); 8 | printf("\nEVEN NUMBERS ARE\n"); 9 | for(i=2;i<=10;i++) 10 | { 11 | if(i%2==0) 12 | { 13 | sum=sum+i; 14 | printf("\t\t%d\n",i); 15 | } 16 | } 17 | printf("\t\n sum=%d",sum); 18 | getch(); 19 | } -------------------------------------------------------------------------------- /EVENSUM.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int i,n,sum=0; 7 | clrscr(); 8 | printf("\nEVEN NUMBERS ARE\n"); 9 | for(i=2;i<=10;i++) 10 | { 11 | if(i%2==0) 12 | { 13 | sum=sum+i; 14 | printf("\t\t%d\n",i); 15 | } 16 | } 17 | printf("\t\n sum=%d",sum); 18 | getch(); 19 | } -------------------------------------------------------------------------------- /EVODD.CPP: -------------------------------------------------------------------------------- 1 | //check whether the entered number is even odd 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int num; 9 | clrscr(); 10 | cout<<"\n\tenter any number"; 11 | cin>>num; 12 | if(num%2==0) 13 | cout< 2 | #include 3 | 4 | void main() 5 | { 6 | int i,n; 7 | clrscr(); 8 | printf("\n\tnumbers from 200 to 300 whiuch are divisable by 5"); 9 | i=200; 10 | n=300; 11 | do 12 | { 13 | if(i%5==0) 14 | printf("%d\t",i); 15 | i++; 16 | } 17 | while(i<=n); 18 | getch(); 19 | } 20 | -------------------------------------------------------------------------------- /EX.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int i,n; 7 | clrscr(); 8 | printf("\n\tnumbers from 200 to 300 whiuch are divisable by 5 are\n\t"); 9 | i=200; 10 | n=300; 11 | do 12 | { 13 | if(i%5==0) 14 | printf("%d\t",i); 15 | i++; 16 | } 17 | while(i<=n); 18 | getch(); 19 | } 20 | -------------------------------------------------------------------------------- /EX1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/EX1.EXE -------------------------------------------------------------------------------- /EXP.BAK: -------------------------------------------------------------------------------- 1 | //program to evaluate an expression 2 | 3 | #include 4 | #include 5 | void main() 6 | { 7 | long int y,a,b,c,x; 8 | clrscr(); 9 | printf("\n\tenter values for a b c x"); 10 | scanf("%ld%ld%ld%ld",&a,&b,&c,&x); 11 | y=a*x*x+b*x+c; 12 | printf("\n\ty=%ld\n\twhere\n\tx=%ld\n\ta=%ld\n\tb=%ld\n\tc=%ld\n",y,x,a,b,c); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /EXP.C: -------------------------------------------------------------------------------- 1 | //program to evaluate an expression 2 | 3 | #include 4 | #include 5 | void main() 6 | { 7 | long int y,a,b,c,x; 8 | clrscr(); 9 | printf("\n\tenter values for a b c x"); 10 | scanf("%ld%ld%ld%ld",&a,&b,&c,&x); 11 | y=a*x*x+b*x+c; 12 | printf("\n\ty=%ld\n\n\twhere\n\tx=%ld\n\ta=%ld\n\tb=%ld\n\tc=%ld",y,x,a,b,c); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /EXP.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int a=10,b=5,c=5,result; 7 | clrscr(); 8 | try 9 | { 10 | result=a/(b-c); 11 | } 12 | catch(ArithmeticException e) 13 | { 14 | cout<<"divide by zero"<>a>>b>>c>>x; 12 | y=a*x*x+b*x+c; 13 | cout<<"\n\ta="< 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | cout<<"\n\tWELCOME TO OOP WITH CPP PROGRAMMING"< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,sum; 9 | clrscr(); 10 | printf("\n\tenter values for a and b"); 11 | scanf("%d%d",&a,&b); 12 | sum=a+b; 13 | printf("\n\ta=%d\n\tb=%d\n\tsum=%d",a,b,sum); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /F1.CPP: -------------------------------------------------------------------------------- 1 | //program to display a line of text 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | cout<<"\n\tWELCOME TO OOP WITH CPP PROGRAMMING"< 4 | #include 5 | float b,h; 6 | void area(float ,float ); 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | printf("\n\tenter base and height of triagle"); 12 | scanf("%f%f",&b,&h); 13 | area(b,h); 14 | getch(); 15 | } 16 | void area(float x,float y) 17 | { 18 | printf("\n\tarea of triangle=%f",0.5*x*y); 19 | } 20 | -------------------------------------------------------------------------------- /F2.CPP: -------------------------------------------------------------------------------- 1 | //*prog to swap 2 nums using dummy variable*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,temp; 7 | clrscr(); 8 | printf("\n enter 2 nums"); 9 | scanf("%d%d",&a,&b); 10 | temp=a; 11 | a=b; 12 | b=temp; 13 | printf("\n after swapping a%d\t b=%d",a,b); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /F5.BAK: -------------------------------------------------------------------------------- 1 | //program to find squeare and cube of a given number 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int n,sq,cube; 9 | clrscr(); 10 | n=10; 11 | sq=n*n; 12 | cube=n*n*n; 13 | printf("\n\tnumber=%d\n\tsquare=%d\n\tcube=%d",n,sq,cube); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /FACT.BAK: -------------------------------------------------------------------------------- 1 | //program to find factorial of given number 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,fact=1; 9 | clrscr(); 10 | printf("\n\nenter any integer"); 11 | scanf("%d",&n); 12 | for(i=1;i<=n;i++) 13 | { 14 | fact=fact*i; 15 | } 16 | printf("\n\nFACTORIAL OF %d is %d",n,fact); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /FACT.C: -------------------------------------------------------------------------------- 1 | //program to find factorial of given number 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,fact=1; 9 | clrscr(); 10 | printf("\n\nenter any integer"); 11 | scanf("%d",&n); 12 | for(i=1;i<=n;i++) 13 | fact=fact*i; 14 | printf("\n\nFACTORIAL OF %d is %d",n,fact); 15 | getch(); 16 | } -------------------------------------------------------------------------------- /FACT.CPP: -------------------------------------------------------------------------------- 1 | //program to find factorial of given number. 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i,num,fact=1; 8 | clrscr(); 9 | cout<<"enter any number to find factorial"; 10 | cin>>num; 11 | for(i=1;i<=num;i++) 12 | { 13 | fact=fact*i; 14 | } 15 | cout<<"\t\tfactorial of "< 3 | #include 4 | 5 | void main() 6 | { 7 | int i,num,fact=1; 8 | clrscr(); 9 | cout<<"\n\tenter any number to find factorial"; 10 | cin>>num; 11 | i=1; 12 | do 13 | { 14 | fact=fact*i; 15 | i++; 16 | }while(i<=num); 17 | cout<<"\\nt\tfactorial of "< 3 | #include 4 | 5 | void main() 6 | { 7 | int i,num,fact=1; 8 | clrscr(); 9 | cout<<"\n\tenter any number to find factorial"; 10 | cin>>num; 11 | i=1; 12 | do 13 | { 14 | fact=fact*i; 15 | i++; 16 | }while(i<=num); 17 | cout<<"\n\t\tfactorial of "< 4 | #include 5 | int a,b,sum; 6 | int addition(int ,int ); 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | cout<<"\n\tenter 2 integers"; 12 | cin>>a>>b; 13 | sum=addition(a,b); 14 | cout<<"\n\tsum="< 4 | #include 5 | int a,b,sum; 6 | int addition(int ,int ); 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | cout<<"\n\tenter 2 integers"; 12 | cin>>a>>b; 13 | sum=addition(a,b); 14 | cout<<"\n\tsum="< 4 | #include 5 | int a,b,sum; 6 | void addition( ); 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | addition(); 12 | getch(); 13 | } 14 | 15 | void addition() 16 | { 17 | cout<<"\n\tenter 2 int"; 18 | cin>>a>>b; 19 | cout<<"\n\tsum="< 4 | #include 5 | int a,b,sum; 6 | void addition( ); 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | addition(); 12 | getch(); 13 | } 14 | 15 | void addition() 16 | { 17 | cout<<"\n\tenter 2 int"; 18 | cin>>a>>b; 19 | cout<<"\n\tsum="< 2 | #include 3 | 4 | float area(float ,float); 5 | 6 | void main() 7 | { 8 | float b,h,ar; 9 | clrscr(); 10 | cout<<"\nenter values for b and h"; 11 | cin>>b>>h; 12 | ar=area(b,h); 13 | cout<<"\n\tarea of triangle="< 4 | #include 5 | int addition(); 6 | int a,b; 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | cout<<"\nsum="<>a>>b; 18 | return(a+b); 19 | } 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /FCAT2.CPP: -------------------------------------------------------------------------------- 1 | //function with return value without arguments 2 | 3 | #include 4 | #include 5 | int addition(); 6 | int a,b; 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | cout<<"\nsum="<>a>>b; 18 | return(a+b); 19 | } 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /FCAT3.BAK: -------------------------------------------------------------------------------- 1 | //function without return value without arguments 2 | 3 | #include 4 | #include 5 | void addition(); 6 | int a,b; 7 | 8 | void main() 9 | { 10 | clrscr(); 11 | addition(); 12 | getch(); 13 | } 14 | void addition() 15 | { 16 | cout<<"\nenter any 2 integers"; 17 | cin>>a>>b; 18 | cout<<"\nsum="<<(a+b); 19 | } 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /FIB.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int i,n,f1=-1,f2=1,f3; 6 | clrscr(); 7 | printf("\nenter final value"); 8 | scanf("%d",&n); 9 | printf("\n Fibonacci series:\n"); 10 | for(i=1;i<=n;i++) 11 | { 12 | f3=f1+f2; 13 | printf("\n \t %d",f3); 14 | f1=f2; 15 | f2=f3; 16 | } 17 | getch(); 18 | } -------------------------------------------------------------------------------- /FIB.C: -------------------------------------------------------------------------------- 1 | //program to display fibonacci series 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i,n,f1=-1,f2=1,f3; 7 | clrscr(); 8 | printf("\nenter final value"); 9 | scanf("%d",&n); 10 | printf("\n Fibonacci series:\n"); 11 | for(i=1;i<=n;i++) 12 | { 13 | f3=f1+f2; 14 | printf("\n \t %d",f3); 15 | f1=f2; 16 | f2=f3; 17 | } 18 | getch(); 19 | } -------------------------------------------------------------------------------- /FILE1.BAK: -------------------------------------------------------------------------------- 1 | //program to display aline of text 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\nWELCOME\n TO C PROGRAMMING"); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /FILE1.C: -------------------------------------------------------------------------------- 1 | //program to display aline of text 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\nWELCOME\n\t TO C PROGRAMMING"); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /FILE1.CPP: -------------------------------------------------------------------------------- 1 | //program to display a msg 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | clrscr(); 8 | cout<<"\n\n\t\twelcome to cpp"< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,c,small; 9 | clrscr(); 10 | cout<<"\n\tENTER VALUES FOR a,b AND c"; 11 | cin>>a>>b>>c; 12 | small=(a 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,c,small; 9 | clrscr(); 10 | cout<<"\n\tENTER VALUES FOR a,b AND c"; 11 | cin>>a>>b>>c; 12 | small=(a>a>>b; 12 | sum=a+b; 13 | cout<<"\n\ta="<>a>>b; 12 | sum=a+b; 13 | cout<<"\n\ta="<>r; 12 | area=3.142*r*r; 13 | cir=2*3.142*r; 14 | cout<<"\n\tRad="< 4 | #include 5 | 6 | void main() 7 | { 8 | float r,area,cir; 9 | clrscr(); 10 | cout<<"\n\tenter radious of circle"; 11 | cin>>r; 12 | area=3.142*r*r; 13 | cir=2*3.142*r; 14 | cout<<"\n\tRadios="< 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("name=madhu"); 8 | getch(); 9 | } 10 | -------------------------------------------------------------------------------- /FILE6.BAK: -------------------------------------------------------------------------------- 1 | //program to find square and cube of a given number 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int n,sq,cube; 9 | clrscr(); 10 | cout<<"\n\tenter any integer"; 11 | cin>>n; 12 | sq=n*n; 13 | cube=n*n*n; 14 | cout<<"\n\tnumber="< 4 | #include 5 | 6 | void main() 7 | { 8 | int n,sq,cube; 9 | clrscr(); 10 | cout<<"\n\tenter any integer"; 11 | cin>>n; 12 | sq=n*n; 13 | cube=n*n*n; 14 | cout<<"\n\tnumber="< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,big; 9 | clrscr(); 10 | cout<<"\n\tENTER VALUES FOR a AND b"; 11 | cin>>a>>b; 12 | big=(a>b)?a:b; 13 | cout<<"\n\na="< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,big; 9 | clrscr(); 10 | cout<<"\n\tENTER VALUES FOR a AND b"; 11 | cin>>a>>b; 12 | big=(a>b)?a:b; 13 | cout<<"\n\ta="< 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b; 9 | clrscr(); 10 | cout<<"\n\tENTER VALUES FOR a AND b"; 11 | cin>>a>>b; 12 | (a>b)?cout<<"\n\t"< 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | cout<<"\n\nWELCOME TO C++ PROGRAMMING"< 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | cout<<"\n\nWELCOME TO C++ PROGRAMMING"< 2 | #include 3 | int main() 4 | { 5 | int r,c; 6 | clrscr(); 7 | for(r=1;r<=3;r++) 8 | { 9 | for(c=1;c<=3;c++) 10 | { 11 | printf("%3d",r); 12 | } 13 | printf("\n"); 14 | } 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /FOR1.BAK: -------------------------------------------------------------------------------- 1 | /*prg to print nums 1 to 5 using for loop */ 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | cout<<"\nnatural numbers up to 5 are"; 10 | for(i=1;i<=5;i++) 11 | { 12 | cout<<"\n\t"< 4 | #include 5 | 6 | void main() 7 | { 8 | int time,i; 9 | clrscr(); 10 | printf("\nHOW MANY TIMES YOU WANT TO DISPLAY YOUR NAME\t"); 11 | scanf("%d",&time); 12 | for(i=0;i 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | cout<<"\nnatural numbers up to 5 are"; 10 | for(i=1;i<=5;i++) 11 | { 12 | cout<<"\n\t"< 8 | #include 9 | 10 | void main() 11 | { 12 | int r,c; 13 | clrscr(); 14 | cout< 8 | #include 9 | 10 | void main() 11 | { 12 | int r,c; 13 | clrscr(); 14 | cout< 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=5;i>=-5;i--) 10 | { 11 | cout<<"\n\t"< 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,p=1; 9 | clrscr(); 10 | printf("\nenter final value"); 11 | scanf("%d",&n); 12 | for(i=1;i<=n;i++) 13 | { 14 | printf("\n\t%d",i); 15 | p=p*i; 16 | } 17 | printf("\nproduct=%d",p); 18 | getch(); 19 | } 20 | -------------------------------------------------------------------------------- /FOR2.CPP: -------------------------------------------------------------------------------- 1 | /*prg to print nums 5 to 1 using for loop */ 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=5;i>=1;i--) 10 | { 11 | cout<<"\n\t"< 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=1;i<=5;i++) 10 | { 11 | cout<<"\n Hello"; 12 | } 13 | getch(); 14 | 15 | } -------------------------------------------------------------------------------- /FOR3.CPP: -------------------------------------------------------------------------------- 1 | /*prg to print Hello message 5 times using for loop */ 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=1;i<=5;i++) 10 | { 11 | cout<<"\n Hello"; 12 | } 13 | getch(); 14 | 15 | } -------------------------------------------------------------------------------- /FOR4.BAK: -------------------------------------------------------------------------------- 1 | //prg to print 1 to 20 even nums using for loop 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=2;i<=20;i=i+2) 10 | { 11 | cout<<"\n\t"< 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=1;i<=20;i++) 10 | { 11 | if(i%2==0) 12 | { 13 | cout<<"\n\t"< 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=50;i<=100;i++) 10 | { 11 | if(i%5==0) 12 | cout<<"\n"< 3 | #include 4 | 5 | void main() 6 | { 7 | int i; 8 | clrscr(); 9 | for(i=50;i<=100;i++) 10 | { 11 | if(i%5==0) 12 | cout<<"\n\t"< 3 | #include 4 | 5 | void main() 6 | { 7 | int i,m,n; 8 | clrscr(); 9 | cout<<"\n enter any num"; 10 | cin>>n; 11 | for(i=1;i<=10;i++) 12 | { 13 | m=i*n; 14 | cout<<"\n\t"< 3 | #include 4 | 5 | void main() 6 | { 7 | int i,m,n; 8 | clrscr(); 9 | cout<<"\n enter any num"; 10 | cin>>n; 11 | for(i=1;i<=10;i++) 12 | { 13 | m=i*n; 14 | cout<<"\n\t"< 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | cout< 7 | #include 8 | void main() 9 | { 10 | int r,c; 11 | clrscr(); 12 | cout< 8 | #include 9 | 10 | void main() 11 | { 12 | int r,c; 13 | clrscr(); 14 | cout< 8 | #include 9 | 10 | void main() 11 | { 12 | int r,c; 13 | clrscr(); 14 | cout< 8 | #include 9 | void main() 10 | { 11 | int r,c; 12 | clrscr(); 13 | for(r=1;r<=4;r++) 14 | { 15 | for(c=1;c<=r;c++) 16 | { 17 | cout<<"\t"< 8 | #include 9 | void main() 10 | { 11 | int r,c; 12 | clrscr(); 13 | for(r=1;r<=4;r++) 14 | { 15 | for(c=1;c<=r;c++) 16 | { 17 | cout<<"\t"< 3 | #include 4 | void main() 5 | { 6 | int a[5],i; 7 | clrscr(); 8 | printf("\nenter array elements\n"); 9 | for(i=0;i<5;i++) 10 | scanf("%d",&a[i]); 11 | printf("\narray elements are\n"); 12 | for(i=0;i<5;i++) 13 | printf("\t\t[%d]=%d\n",i,a[i]); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /FORTABLE.BAK: -------------------------------------------------------------------------------- 1 | //display multiplication table up to 10 using for loop 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,result; 9 | clrscr(); 10 | printf("\n\tenter number to display multiplication table"); 11 | scanf("%d",&n); 12 | for(i=1;i<=10;i++) 13 | { 14 | result=n*i; 15 | printf("\n\t%d*%d=%d",n,i,result); 16 | } 17 | getch(); 18 | } -------------------------------------------------------------------------------- /FORTABLE.C: -------------------------------------------------------------------------------- 1 | //display multiplication table up to 10 using for loop 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,result; 9 | clrscr(); 10 | printf("\n\tenter number to display multiplication table"); 11 | scanf("%d",&n); 12 | for(i=1;i<=10;i++) 13 | { 14 | result=n*i; 15 | printf("\n\t%dX%d=%d",n,i,result); 16 | } 17 | getch(); 18 | } -------------------------------------------------------------------------------- /FR3.BAK: -------------------------------------------------------------------------------- 1 | //program to display your name for the specified number of time 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i,time; 8 | clrscr(); 9 | ptintf("\nHOW MANY TIMES YOU WANT TO DISPLAY YOUR NAME"); 10 | scanf("%d",&time); 11 | for(i=0;i 3 | #include 4 | 5 | void main() 6 | { 7 | int i,time; 8 | clrscr(); 9 | printf("\nHOW MANY TIMES YOU WANT TO DISPLAY YOUR NAME"); 10 | scanf("%d",&time); 11 | for(i=0;i 2 | #include 3 | 4 | void main() 5 | { 6 | int i,s=0; 7 | clrscr(); 8 | printf("\n\teven numbers up to 10"); 9 | for(i=2;i<=10;i=i+2) 10 | { 11 | printf("\n\t%d",i); 12 | s=s+i; 13 | } 14 | printf("\n\tSUM OF EVEN NUMBERS UP TO 10 ARE= %d",s); 15 | getch(); 16 | } 17 | -------------------------------------------------------------------------------- /FR4.C: -------------------------------------------------------------------------------- 1 | //sum of even numbers up to 10 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i,s=0; 8 | clrscr(); 9 | printf("\n\teven numbers up to 10"); 10 | for(i=2;i<=10;i=i+2) 11 | { 12 | printf("\n\t%d",i); 13 | s=s+i; 14 | } 15 | printf("\n\tSUM OF EVEN NUMBERS UP TO 10 ARE= %d",s); 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /FUN1.CPP: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /FUN20.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/FUN20.C -------------------------------------------------------------------------------- /FUNC.BAK: -------------------------------------------------------------------------------- 1 | //program to add two numbers using function 2 | #include 3 | #include 4 | int addition(); 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | cout<<"\n\n\tsum="< 4 | #include 5 | int addition(); 6 | 7 | void main() 8 | { 9 | clrscr(); 10 | cout<<"\n\n\tsum="< 2 | #include 3 | 4 | void rectangle(int ,int ); 5 | void main() 6 | { 7 | int b,h; 8 | clrscr(); 9 | cout<<"\nenter values for b and h"; 10 | cin>>b>>h; 11 | rectangle(b,h); 12 | getch(); 13 | } 14 | void rectangle(int b ,int h) 15 | { 16 | cout<<"area of rectangle="< 3 | #include 4 | 5 | void rectangle(int ,int ); 6 | void main() 7 | { 8 | int b,h; 9 | clrscr(); 10 | cout<<"\nenter values for b and h"; 11 | cin>>b>>h; 12 | rectangle(b,h); 13 | getch(); 14 | } 15 | void rectangle(int b ,int h) 16 | { 17 | cout<<"area of rectangle="< 2 | #include 3 | int a,b,big; 4 | int sample(int ,int); 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\nenter vcalues for a and b"); 10 | scanf("%d%d",&a,&b); 11 | printf("\n\tbig=%d",sample(a,b)); 12 | getch(); 13 | } 14 | int sample(int p,int q) 15 | { 16 | 17 | big=p>q?p:q; 18 | return(big); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /F_C1.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int a,b,big; 4 | int sample(); 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\n\tbig=%d",sample(a,b)); 10 | getch(); 11 | } 12 | int sample() 13 | { 14 | printf("\nenter vcalues for a and b"); 15 | scanf("%d%d",&a,&b); 16 | big=a>b?a:b; 17 | return(big); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /G.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int a,b,c; 6 | clrscr(); 7 | cout<<"Enter values for a,b,c"; 8 | cin>>a>>b>>c; 9 | 10 | if(a>b && a>c) 11 | { 12 | cout<a && b>c) 16 | { 17 | cout< 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | cout<<"All"< 4 | #include 5 | void main() 6 | { 7 | clrscr() 8 | printf("\n welcome to c programing"); 9 | getch() 10 | } -------------------------------------------------------------------------------- /GREP.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/GREP.COM -------------------------------------------------------------------------------- /GREP2MSG.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/GREP2MSG.EXE -------------------------------------------------------------------------------- /H.CPP: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /HAR1.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | char str[20]; 6 | clrscr(); 7 | printf("enter any string\n"); 8 | gets(str); 9 | scanf("%s",&str); 10 | printf("\n entererd string is :%s",str); 11 | getch(); 12 | } -------------------------------------------------------------------------------- /HELLO.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main () 4 | { 5 | int i=1; 6 | clrscr(); 7 | while (i<=5) 8 | { 9 | printf(" \n hello"); 10 | i++; 11 | } 12 | getch(); 13 | } -------------------------------------------------------------------------------- /HHHHSSS.BAK: -------------------------------------------------------------------------------- 1 | /*program to find biggest of two numbers using simple if*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("/n enter any two numbers"); 9 | scanf("%d%d",&a,&b); 10 | if(a>b) 11 | { 12 | printf("/n %d is big",a); 13 | } 14 | if(b>a) 15 | { 16 | printf("/n %d is big",b); 17 | } 18 | getch(); 19 | } -------------------------------------------------------------------------------- /HHHHSSS.C: -------------------------------------------------------------------------------- 1 | /*program to find biggest of two numbers using simple if*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n enter any two numbers"); 9 | scanf("%d%d",&a,&b); 10 | if(a>b) 11 | { 12 | printf("\n %d is big",a); 13 | } 14 | if(b>a) 15 | { 16 | printf("\n %d is big",b); 17 | } 18 | getch(); 19 | } -------------------------------------------------------------------------------- /IF.C: -------------------------------------------------------------------------------- 1 | //to check person is elegible to vote 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int age; 9 | clrscr(); 10 | printf("\nenter age of the person"); 11 | scanf("%d",&age); 12 | if(age>=18) 13 | { 14 | printf("\nEligible to VOTE"); 15 | } 16 | getch(); 17 | } -------------------------------------------------------------------------------- /IFELSE1.BAK: -------------------------------------------------------------------------------- 1 | //to check person is elegible to vote or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int age; 9 | clrscr(); 10 | printf("\nenter age of the person"); 11 | scanf("%d",&age); 12 | if(age>=18) 13 | { 14 | printf("\nEligible to VOTE"); 15 | } 16 | else 17 | { 18 | printf("\n NOT eligible to VOTE"); 19 | } 20 | getch(); 21 | } -------------------------------------------------------------------------------- /IFELSE1.CPP: -------------------------------------------------------------------------------- 1 | //program to check whether m is divisable by n or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int m,n; 9 | clrscr(); 10 | cout<<"\nenter values for m and n"; 11 | cin>>m>>n; 12 | if(m%n==0) 13 | cout<<"\n\t"< 4 | #include 5 | 6 | void main() 7 | { 8 | int num; 9 | clrscr(); 10 | cout<<"\n\tenter any number"; 11 | cin>>num; 12 | if(num>0) 13 | cout< 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n\tenter values for a and b"); 9 | scanf("%d%d",&a,&b); 10 | if(a>b) 11 | { 12 | printf("\n\t%d is big",a); 13 | } 14 | else 15 | { 16 | printf("\n\t%d is big",b); 17 | } 18 | getch();} -------------------------------------------------------------------------------- /IFELSE5.C: -------------------------------------------------------------------------------- 1 | //program to find biggest of 2 numbers 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int a,b; 8 | clrscr(); 9 | printf("\n\tenter values for a and b"); 10 | scanf("%d%d",&a,&b); 11 | if(a>b) 12 | { 13 | printf("\n\t%d is big",a); 14 | } 15 | else 16 | { 17 | printf("\n\t%d is big",b); 18 | } 19 | getch(); 20 | } -------------------------------------------------------------------------------- /IFFF.BAK: -------------------------------------------------------------------------------- 1 | //program to check whether the entered number is even or odd 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\nenter any integer"); 10 | scanf("%d",&n); 11 | if(n%2==0) 12 | { 13 | printf("\t\t%d is EVEN",n); 14 | } 15 | else 16 | { 17 | printf("\t\t%d is ODD",n); 18 | } 19 | getch(); 20 | 21 | } -------------------------------------------------------------------------------- /IFFF.C: -------------------------------------------------------------------------------- 1 | //program to check whether the entered number is even or odd 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\nenter any integer"); 10 | scanf("%d",&n); 11 | if(n%2==0) 12 | { 13 | printf("\t\t%d is EVEN",n); 14 | } 15 | else 16 | { 17 | printf("\t\t%d is ODD",n); 18 | } 19 | getch(); 20 | } -------------------------------------------------------------------------------- /IF_ELSE.BAK: -------------------------------------------------------------------------------- 1 | //illustration of control statements 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int age; 9 | clrscr(); 10 | cout<<"\n\tenter age"; 11 | cin>>age; 12 | if(age>=18) 13 | cout<<"\n\teligible to vote"; 14 | else 15 | cout<<"\n\t not eligible to vote"; 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /IF_ELSE.CPP: -------------------------------------------------------------------------------- 1 | //illustration of control statements 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int age; 9 | clrscr(); 10 | cout<<"\n\tenter age"; 11 | cin>>age; 12 | if(age>=18) 13 | cout< 4 | #include 5 | 6 | void main() 7 | { 8 | int m,n; 9 | clrscr(); 10 | printf("\n\t enter values for m and n"); 11 | scanf("%d%d",&m,&n); 12 | if(m%n==0) 13 | printf("\n\n\t%d is divisable by %d",m,n); 14 | else 15 | printf("\n\n\t%d is NOT divisable by %d",m,n); 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /IF_ELSE2.C: -------------------------------------------------------------------------------- 1 | //program to check whether m is divisable by n or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int m,n; 9 | clrscr(); 10 | printf("\n\t enter values for m and n"); 11 | scanf("%d%d",&m,&n); 12 | if(m%n==0) 13 | printf("\n\n\t%d is divisable by %d",m,n); 14 | else 15 | printf("\n\n\t%d is NOT divisable by %d",m,n); 16 | getch(); 17 | } 18 | -------------------------------------------------------------------------------- /IF_ELSE2.CPP: -------------------------------------------------------------------------------- 1 | //check whether the student is pass or fail in subject 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int marks; 9 | clrscr(); 10 | cout<<"\n\tenter marks of student"; 11 | cin>>marks; 12 | if(marks>=35) 13 | cout< 3 | #include 4 | void main() 5 | { 6 | int i=10,j=20; 7 | clrscr(); 8 | printf("\n before incrementing i=%d \t j=%d",i,j); 9 | printf("\n after incrementing i=%d",i++); 10 | printf("\n i=%d",i); 11 | printf("\n j=%d",++j); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /INCRE.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | int i=50,j=20; 6 | clrscr(); 7 | printf("\n i=%d", ++i); 8 | printf("\n j=%d", j++); 9 | printf("\n %d", j); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /IN_LINE.BAK: -------------------------------------------------------------------------------- 1 | //illustrate inline function 2 | #include 3 | #include 4 | inline int big(int a,int b) 5 | { 6 | return(a>b?a:b); 7 | } 8 | void main() 9 | { 10 | int x,y,z; 11 | clrscr(); 12 | cout<<"\nEnter x,y values"; 13 | cin>>x>>y; 14 | z=big(x,y); 15 | cout<<"\nbig="< 3 | #include 4 | inline int big(int a,int b) 5 | { 6 | return(a>b?a:b); 7 | } 8 | void main() 9 | { 10 | int x,y,z; 11 | clrscr(); 12 | cout<<"\nEnter x,y values"; 13 | cin>>x>>y; 14 | z=big(x,y); 15 | cout<<"\nbig="< 3 | #include 4 | inline float area(float b,float h ) 5 | { 6 | return(0.5*b*h); 7 | } 8 | void main() 9 | { 10 | float x,y,z; 11 | clrscr(); 12 | cout<<"\nEnter x,y values"; 13 | cin>>x>>y; 14 | z=area(x,y); 15 | cout<<"\n 16 | 17 | 18 | 19 | area of triangle="< 3 | #include 4 | inline float area(float b,float h ) 5 | { 6 | return(0.5*b*h); 7 | } 8 | void main() 9 | { 10 | float x,y,z; 11 | clrscr(); 12 | cout<<"\nEnter x,y values"; 13 | cin>>x>>y; 14 | z=area(x,y); 15 | cout<<"\narea of triangle="< 2 | #include 3 | inline void area(float b,float h ) 4 | { 5 | cout<<"\narea of the triangle="<<(0.5*b*h); 6 | } 7 | void main() 8 | { 9 | float x,y,z; 10 | clrscr(); 11 | cout<<"\nEnter x,y values"; 12 | cin>>x>>y; 13 | area(x,y); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /IN_LINE2.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | inline void area(float b,float h ) 4 | { 5 | cout<<"\narea of the triangle="<<(0.5*b*h); 6 | } 7 | void main() 8 | { 9 | float x,y; 10 | clrscr(); 11 | cout<<"\nEnter x,y values"; 12 | cin>>x>>y; 13 | area(x,y); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /IN_LINE3.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | inline float area(float b,float h ) 4 | { 5 | return(0.5*b*h); 6 | } 7 | void main() 8 | { 9 | float x,y,z[5]; 10 | clrscr(); 11 | for(int i=0;i<3;i++) 12 | { 13 | cout<<"\nEnter x,y values"; 14 | cin>>x>>y; 15 | z[i]=area(x,y); 16 | cout<<"\n area= "< 2 | #include 3 | #include 4 | int main() 5 | { 6 | char ch; 7 | clrscr(); 8 | printf(" enter any character "); 9 | scanf("%c",&ch); 10 | if(isalpha(ch)) 11 | printf(" %c is a alphabet ",ch); 12 | else if(isdigit(ch)) 13 | printf(" %c is a digit",ch); 14 | else 15 | printf(" %c is a special character",ch); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /JAN1.BAK: -------------------------------------------------------------------------------- 1 | //program to display a line of text 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\n\n\tWELCOME TO C PROGRAM"); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /JAN1.C: -------------------------------------------------------------------------------- 1 | //program to display a line of text 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\n\n\tWELCOME TO C PROGRAM"); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /JAN2.BAK: -------------------------------------------------------------------------------- 1 | //program to display your name and course 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\n\n\tWELCOME TO C PROGRAM\n\n"); 10 | printf(" Name:XYZ\n\n"); 11 | printf("Address:Hosur\tHubli"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /JAN2.C: -------------------------------------------------------------------------------- 1 | //program to display your name and course 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | clrscr(); 9 | printf("\n\n\tWELCOME TO C PROGRAM\n\n"); 10 | printf("\t Name:XYZ\n\n"); 11 | printf("\tAddress:Hosur\tHubli"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /JAN4.C: -------------------------------------------------------------------------------- 1 | //program to find sum of 2 numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,sum; 9 | clrscr(); 10 | a=10; 11 | b=20; 12 | sum=a+b; 13 | printf("\n\ta=%d\n\tb=%d\n\tsum=%d",a,b,sum); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /JAN5.BAK: -------------------------------------------------------------------------------- 1 | //program to find sum and average of 3 numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,c,sum,avg; 9 | clrscr(); 10 | a=10; 11 | b=20; 12 | c=30; 13 | sum=a+b+c; 14 | avg=sum/3; 15 | printf("\n\n\ta=%d\n\n\tb=%d\n\n\tc=%d",a,b,c); 16 | printf("\n\n\tsum=%d\n\ntaverage=%d",sum,avg); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /JAN5.C: -------------------------------------------------------------------------------- 1 | //program to find sum and average of 3 numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,c,sum,avg; 9 | clrscr(); 10 | a=10; 11 | b=20; 12 | c=30; 13 | sum=a+b+c; 14 | avg=sum/3; 15 | printf("\n\n\ta=%d\n\n\tb=%d\n\n\tc=%d",a,b,c); 16 | printf("\n\n\tsum=%d\n\n\taverage=%d",sum,avg); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /JAN7.C: -------------------------------------------------------------------------------- 1 | //program to find sum of 2 numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int a,b,sum; 9 | clrscr(); 10 | printf("\n\n\tenter 2 integer values"); 11 | scanf("%d%d",&a,&b); 12 | sum=a+b; 13 | printf("\n\n\ta=%d\n\n\tb=%d\n\n\tsum=%d",a,b,sum); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /JAN8.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int a,b,c,x,y; 7 | clrscr(); 8 | printf("\n\n\tenter values for a b c x"); 9 | scanf("%d%d%d%d",&a,&b,&c,&x); 10 | y=a*x*x+b*x+c; 11 | printf("\n\ta=%d\n\tb=%d\n\tc=%d\n\tx=%d\n\ty=%d",a,b,c,x,y); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /JAN8.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() 5 | { 6 | int a,b,c,x,y; 7 | clrscr(); 8 | printf("\n\n\tenter values for a b c x"); 9 | scanf("%d%d%d%d",&a,&b,&c,&x); 10 | y=a*x*x+b*x+c; 11 | printf("\n\ta=%d\n\tb=%d\n\tc=%d\n\tx=%d\n\ty=%d",a,b,c,x,y); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /JP4.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void swap(int *a,int *b); 4 | int main(); 5 | { 6 | -------------------------------------------------------------------------------- /K.BAK: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int a; 6 | clrscr(); 7 | printf("\n enter a value"); 8 | scanf("%d", &a); 9 | (a%2==0)?printf("\n a is even"):printf("\n a is odd"); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /K.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/K.C -------------------------------------------------------------------------------- /K.CPP: -------------------------------------------------------------------------------- 1 | /*Program to find sum of two numbers*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,sum; 7 | clrscr(); 8 | printf("\n Enter any two numbers"); 9 | scanf("%d%d",&a,&b); 10 | sum=a+b; 11 | printf("\n sum of two numbers=%d",sum); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /K1.BAK: -------------------------------------------------------------------------------- 1 | /*program to display a simple message*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n Welcome to C programming"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /K1.C: -------------------------------------------------------------------------------- 1 | /*program to display a simple message*/ 2 | #include 3 | #include 4 | main() 5 | { 6 | clrscr(); 7 | printf("\n Welcome to C programming"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /K1.CPP: -------------------------------------------------------------------------------- 1 | /*Program to display a simple message*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | cout<<"\n Welcome to C++"; 8 | getch(); 9 | 10 | } -------------------------------------------------------------------------------- /K2.BAK: -------------------------------------------------------------------------------- 1 | /*Program to find sum of two nums using global variable*/ 2 | #include 3 | #include 4 | int sum; 5 | void main() 6 | { 7 | int a,b; 8 | clrscr(); 9 | cout<<"\n Enter two nums"; 10 | cin>>a>>b; 11 | sum=a+b; 12 | cout<<"\n Sum of two nums="< 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str[20]; 8 | clrscr(); 9 | printf("\n Enter any string "); 10 | gets(str); 11 | printf("\n Entered string is %s ",str); 12 | printf("\n Reversed string is %s ",strrev(str)); 13 | 14 | getch(); 15 | } 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /K2.CPP: -------------------------------------------------------------------------------- 1 | /*Program to find sum of two nums using global variable*/ 2 | #include 3 | #include 4 | int sum; //global variable 5 | void main() 6 | { 7 | int a,b; 8 | clrscr(); 9 | cout<<"\n Enter two nums"; 10 | cin>>a>>b; 11 | sum=a+b; 12 | cout<<"\n Sum of two nums="< 3 | #include 4 | #include 5 | void main() 6 | { 7 | char str[20]; 8 | clrscr(); 9 | printf("\n Enter any string "); 10 | gets(str); 11 | printf("\n Entered string is %s ",str); 12 | printf("\n Length of given string is %d ",strlen(str)); 13 | 14 | getch(); 15 | } -------------------------------------------------------------------------------- /K4.BAK: -------------------------------------------------------------------------------- 1 | /*Program to demonstrate increment operators*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=10,j=20; 7 | clrscr(); 8 | cout<<"\n Before incrementing i="< 3 | #include 4 | void main() 5 | { 6 | int i=10,j=20; 7 | clrscr(); 8 | cout<<"\n Before decrementing i="<>a>>b; 10 | int res=(a>b)?a:b; 11 | cout<<"\n Biggest of two nums="< 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | cout<<"\n Enter two numbers"; 9 | cin>>a>>b; 10 | (a>b)?cout<<"\n first no is big":cout<<"\n second no is big"; 11 | getch(); 12 | } -------------------------------------------------------------------------------- /KAVYA.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | int i; 6 | clrscr(); 7 | for(i=1;i<=10;i++) 8 | { 9 | if(i%2==0) 10 | { 11 | printf("\n even no=%d",i); 12 | } 13 | } 14 | getch(); 15 | 16 | } -------------------------------------------------------------------------------- /KEO1.C: -------------------------------------------------------------------------------- 1 | //prg to print a simple message 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n welcome to c"); 8 | getch(); 9 | } -------------------------------------------------------------------------------- /KEO1.CPP: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n\n\n********************************************************"); 8 | printf("\n well come to keonices"); 9 | printf("\n********************************************************"); 10 | getch(); 11 | } -------------------------------------------------------------------------------- /KS.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/KS.C -------------------------------------------------------------------------------- /L1.BAK: -------------------------------------------------------------------------------- 1 | //display odd up to n using while 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\n\t enter final value"); 11 | scanf("%d",&n); 12 | printf("\n\tODD NUMBERs UP TO %d are\n",n); 13 | i=1; 14 | while(i<=n) 15 | { 16 | printf("\t%d\n",i); 17 | i=i+2; 18 | } 19 | getch(); 20 | } 21 | -------------------------------------------------------------------------------- /L1.C: -------------------------------------------------------------------------------- 1 | //display odd up to n using while 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\n\t enter final value"); 11 | scanf("%d",&n); 12 | printf("\n\tEVEN NUMBERs UP TO %d are\n",n); 13 | i=2; 14 | while(i<=n) 15 | { 16 | printf("\t%d\n",i); 17 | i=i+2; 18 | } 19 | getch(); 20 | } 21 | -------------------------------------------------------------------------------- /L2.C: -------------------------------------------------------------------------------- 1 | //do while 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,p=1; 9 | clrscr(); 10 | printf("\n enter value for n"); 11 | scanf("%d",&n); 12 | printf("\nnatural numbers are\n"); 13 | for(i=1;i<=n;i++) 14 | { 15 | printf("\n\t%d",i); 16 | p=p*i; 17 | } 18 | printf("\n\tproduct=%d",p); 19 | getch(); 20 | } -------------------------------------------------------------------------------- /LAR1.CPP: -------------------------------------------------------------------------------- 1 | /*prg to find largest of twon no using sub program*/ 2 | #include 3 | #include 4 | void lar(int a,int b); 5 | void main() 6 | { 7 | int x,y,z; 8 | clrscr(); 9 | cout<<"Enter x,y "; 10 | cin>>x>>y; 11 | lar(x,y); 12 | getch(); 13 | } 14 | void lar(int a,int b) 15 | { 16 | int c; 17 | c=(a>b)?a:b; 18 | cout<<"\n Largest of two nu"< 4 | #include 5 | 6 | void main() 7 | { 8 | int year; 9 | clrscr(); 10 | printf("\n\tenter year"); 11 | scanf("%d",&year); 12 | if(year%4==0) 13 | printf("\n\t%d is leap year",year); 14 | else 15 | printf("\n\t%d is NOT leap year",year); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /LEAP1.C: -------------------------------------------------------------------------------- 1 | //program to check whether the entered year is leap year or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int year; 9 | clrscr(); 10 | printf("\n\tenter year"); 11 | scanf("%d",&year); 12 | if(year%4==0) 13 | printf("\n\t%d is leap year",year); 14 | else 15 | printf("\n\t%d is NOT leap year",year); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /LEAPY.BAK: -------------------------------------------------------------------------------- 1 | //program to check whether the entered year is leap year or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int year; 9 | clrscr(); 10 | printf("\nenter year"); 11 | scanf("%d",&year); 12 | if(year%4==0) 13 | printf("\nleap year"); 14 | else 15 | printf("\nnot leap year"); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /LEAPY.C: -------------------------------------------------------------------------------- 1 | //program to check whether the entered year is leap year or not 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int year; 9 | clrscr(); 10 | printf("\nenter year"); 11 | scanf("%d",&year); 12 | if(year%4==0) 13 | printf("\nleap year"); 14 | else 15 | printf("\n\tnot leap year"); 16 | getch(); 17 | } -------------------------------------------------------------------------------- /LEAPYEAR.BAK: -------------------------------------------------------------------------------- 1 | //c prg leap yera or not leap yera// 2 | #include 3 | #include 4 | void main() 5 | { 6 | int yera; 7 | clrscr(); 8 | printf("enter an year\n"); 9 | scanf("%d",&year); 10 | if((yera%4=0 && year%100!=0)||(year%400=0)) 11 | printf("entered year is leap year\n"); 12 | else 13 | printf("entered year is not leap year\n"); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /LEAPYEAR.CPP: -------------------------------------------------------------------------------- 1 | //c prg leap yera or not leap yera// 2 | #include 3 | #include 4 | void main() 5 | { 6 | int yera; 7 | clrscr(); 8 | printf("enter an year\n"); 9 | scanf("%d",&year); 10 | if(yera%4=0 && year%100!=0)||(year%400=0)) 11 | printf("entered year is leap year\n"); 12 | else 13 | printf("entered year is not leap year\n"); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /LOOP1.C: -------------------------------------------------------------------------------- 1 | //to display product of n natural numbers 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n,p=1; 9 | clrscr(); 10 | printf("\n\tenter final value"); 11 | scanf("%d",&n); 12 | i=1; 13 | do 14 | { 15 | printf("\n\t%d",i); 16 | p=p*i; 17 | i++; 18 | } while(i<=n); 19 | printf("\n\tproduct=%d",p); 20 | getch(); 21 | } -------------------------------------------------------------------------------- /LOOP2.BAK: -------------------------------------------------------------------------------- 1 | //prog to display even numbers up to n 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i,n; 7 | clrscr(); 8 | cout<<"enter final value"; 9 | cin>>n; 10 | i=2; 11 | while(i<=n) 12 | { 13 | cout<<"\t\t"< 3 | #include 4 | void main() 5 | { 6 | int i,n; 7 | clrscr(); 8 | cout<<"\n\nenter final value"; 9 | cin>>n; 10 | i=2; 11 | while(i<=n) 12 | { 13 | cout<<"\t\t"< 5 | #include 6 | 7 | void main() 8 | { 9 | int i,n,sum=0; 10 | clrscr(); 11 | cout<<"enter final value"; 12 | cin>>n; 13 | i=1; 14 | while(i<=n) 15 | { 16 | cout<<"\t\t"<>n; 11 | i=1; 12 | while(i<=n) 13 | { 14 | cout<<"\t\t"<>n; 11 | i=1; 12 | while(i<=n) 13 | { 14 | 15 | fact=fact*i; 16 | i++; 17 | } 18 | cout<<"\n\t\tfactorial of"<>n; 11 | i=1; 12 | while(i<=n) 13 | { 14 | 15 | fact=fact*i; 16 | i++; 17 | } 18 | cout<<"\n\t\tfactorial of"< 4 | #include 5 | void main() 6 | { 7 | int i,n; 8 | clrscr(); 9 | n=200; 10 | i=100; 11 | cout<<"\nEVEN NUMBERS FROM 100 TO 200\n"; 12 | while(i<=n) 13 | { 14 | cout<<"\t"< 5 | #include 6 | 7 | void main() 8 | { 9 | int i,n; 10 | clrscr(); 11 | // cout<<"enter final value"; 12 | // cin>>n; 13 | i=2; 14 | do 15 | { 16 | cout<>n; 12 | i=1; 13 | while(i<=n) 14 | { 15 | cout< 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\n\tenter final value"); 11 | scanf("%d",&n); 12 | printf("\n\tNatural Numbers Are\n"); 13 | i=1; 14 | while(i<=n) 15 | { 16 | printf("\n\t%d",i); 17 | i++; 18 | } 19 | getch(); 20 | } -------------------------------------------------------------------------------- /LP1.CPP: -------------------------------------------------------------------------------- 1 | //program to display n natural numbers using while loop 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\n\tenter final value"); 11 | scanf("%d",&n); 12 | printf("\n\tNatural Numbers Are\n"); 13 | i=1; 14 | while(i<=n) 15 | { 16 | printf("\n\t%d",i); 17 | i++; 18 | } 19 | getch(); 20 | } -------------------------------------------------------------------------------- /LP10.BAK: -------------------------------------------------------------------------------- 1 | //display odd numbers up to n 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\nenter final value"); 11 | scanf("%d",&n); 12 | printf("\n\todd numbers up to %d are\n",n); 13 | i=1; 14 | while(i<=n) 15 | { 16 | printf("%d\n",i); 17 | i=i+2; 18 | } 19 | getch(); 20 | } 21 | -------------------------------------------------------------------------------- /LP10.C: -------------------------------------------------------------------------------- 1 | //display odd numbers up to n 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\nenter final value"); 11 | scanf("%d",&n); 12 | printf("\n\todd numbers up to %d are\n",n); 13 | i=1; 14 | while(i<=n) 15 | { 16 | printf("\n\t%d",i); 17 | i=i+2; 18 | } 19 | getch(); 20 | } 21 | -------------------------------------------------------------------------------- /LP11.BAK: -------------------------------------------------------------------------------- 1 | //display even numbers from 50 to 100 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i=50,n=100; 9 | clrscr(); 10 | printf("\neven numbers from 50 to 100"); 11 | while(i<=n) 12 | { 13 | printf("\n\t%d",i); 14 | i=i+2; 15 | } 16 | getch(); 17 | } -------------------------------------------------------------------------------- /LP11.C: -------------------------------------------------------------------------------- 1 | //display even numbers from 50 to 100 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i=50,n=100; 9 | clrscr(); 10 | printf("\neven numbers from 50 to 100"); 11 | while(i<=n) 12 | { 13 | printf("\t%d",i); 14 | i=i+2; 15 | } 16 | getch(); 17 | } -------------------------------------------------------------------------------- /LP13.BAK: -------------------------------------------------------------------------------- 1 | //program to display reverse numbers from n 2 | 3 | #include 4 | #include 5 | void main() 6 | { 7 | int i,n; 8 | clrscr(); 9 | printf("\nenter final value"); 10 | scanf("%d",&n); 11 | i=1; 12 | do 13 | { 14 | printf("%d\n",n); 15 | n=n-1; 16 | }while(i<=n); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /LP13.C: -------------------------------------------------------------------------------- 1 | //program to display reverse numbers from n 2 | 3 | #include 4 | #include 5 | void main() 6 | { 7 | int i,n; 8 | clrscr(); 9 | printf("\nenter final value"); 10 | scanf("%d",&n); 11 | i=1; 12 | do 13 | { 14 | printf("\n\t%d",n); 15 | n=n-1; 16 | }while(i<=n); 17 | getch(); 18 | } -------------------------------------------------------------------------------- /LP4.BAK: -------------------------------------------------------------------------------- 1 | //program to display even numbers up to n 2 | 3 | #include 4 | #include 5 | 6 | void main() 7 | { 8 | int i,n; 9 | clrscr(); 10 | printf("\n\tenter final value"); 11 | scanf("%d",&n); 12 | printf("\n\tEVEN Numbers Are\n"); 13 | i=2; 14 | while(i<=n) 15 | { 16 | printf("\n\t%d",i); 17 | i=i+2; 18 | } 19 | getch(); 20 | } -------------------------------------------------------------------------------- /LP4.C: -------------------------------------------------------------------------------- 1 | //program to display even numbers up to n 2 | #include 3 | #include 4 | 5 | void main() 6 | { 7 | int i,n; 8 | clrscr(); 9 | printf("\n\tenter final value"); 10 | scanf("%d",&n); 11 | printf("\n\tEVEN Numbers Are\n"); 12 | i=2; 13 | while(i<=n) 14 | { 15 | printf("\n\t%d",i); 16 | i=i+2; 17 | } 18 | getch(); 19 | } -------------------------------------------------------------------------------- /M.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main() 4 | { 5 | int x,*p,*p2; 6 | clrscr(); 7 | x=25; 8 | p=&x; 9 | p2=&p; 10 | printf("\n x value=%d",x); 11 | printf("\n adress of x= %d",p); 12 | printf("\n adress of p=%d",p2); 13 | printf("\n adress of p2=%d",&p2); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /M1.BAK: -------------------------------------------------------------------------------- 1 | //prg to print resume. 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n\n************BIODATA*****************"); 8 | printf("\n Name: Basu"); 9 | printf("\n Address: Hosur"); 10 | printf("\n City: Hubli"); 11 | printf("\n****************END*******************"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M1.C: -------------------------------------------------------------------------------- 1 | /*prg to display a simple message*/ 2 | #include 3 | #include 4 | main() 5 | { 6 | clrscr(); //clear the screen 7 | printf("\n Welcome to C programming"); 8 | getch(); //displays output on screen 9 | } -------------------------------------------------------------------------------- /M1.CPP: -------------------------------------------------------------------------------- 1 | //prg to print resume. 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | printf("\n\n************BIODATA*****************"); 8 | printf("\n Name: Basu"); 9 | printf("\n Address: Hosur"); 10 | printf("\n City: Hubli"); 11 | printf("\n****************END*******************"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M10.BAK: -------------------------------------------------------------------------------- 1 | /*prg to check whether the given year is a leap year or not 2 | using conditional operator */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int yr; 8 | clrscr(); 9 | printf("\n Enter any year"); 10 | scanf("%d",&yr); 11 | (yr%4==0)?printf("\n %d is a Leap year",yr):printf("\n Not a Leap year"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M10.C: -------------------------------------------------------------------------------- 1 | /*prg to check whether the given year is a leap year or not 2 | using conditional operator */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int yr; 8 | clrscr(); 9 | printf("\n Enter any year"); 10 | scanf("%d",&yr); 11 | (yr%4==0)?printf("\n %d is a Leap year",yr):printf("\n Not a Leap year"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M10.CPP: -------------------------------------------------------------------------------- 1 | //program to find the sum and average of three numbers 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,c; 7 | float sum,avg; 8 | clrscr(); 9 | cout<<"\n enter three numbers:"; 10 | cin>>a>>b>>c; 11 | sum=a+b+c; 12 | avg=sum/3; 13 | cout<<"\n sum="< 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | cout<<"enter two numbers:"; 9 | cin>>a>>b; 10 | (a>b)?cout<<"\n a is big ":cout<<"\n b is big"; 11 | getch(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /M11.C: -------------------------------------------------------------------------------- 1 | /*prg to find the biggest of two nums 2 | using conditional operator */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int a,b; 8 | clrscr(); 9 | printf("\n Enter two nums"); 10 | scanf("%d%d",&a,&b); 11 | (a>b)?printf("\n %d is big",a):printf("\n %d is big",b); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M11.CPP: -------------------------------------------------------------------------------- 1 | //program to find biggest of two numbers using conitional operator 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | cout<<"enter two numbers:"; 9 | cin>>a>>b; 10 | (a>b)?cout<<"\n a is big ":cout<<"\n b is big"; 11 | getch(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /M12.BAK: -------------------------------------------------------------------------------- 1 | /*program to check whether given no is even or odd using 2 | conditional operator*/ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | cout<<"enter any numbers:"; 10 | cin>>n; 11 | (n%2==0)?cout<<"\n Even no ":cout<<"\n odd no"; 12 | 13 | getch(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /M12.C: -------------------------------------------------------------------------------- 1 | /*prg to find the biggest of two nums 2 | using conditional operator */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int a,b,lar; 8 | clrscr(); 9 | printf("\n Enter two nums"); 10 | scanf("%d%d",&a,&b); 11 | lar=(a>b)?a:b; 12 | printf("\n Biggest of two nums=%d",lar); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M12.CPP: -------------------------------------------------------------------------------- 1 | /*program to check whether given no is even or odd using 2 | conditional operator*/ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | cout<<"enter any number"; 10 | cin>>n; 11 | (n%2==0)?cout<<"\n Even no ":cout<<"\n odd no"; 12 | 13 | getch(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /M13.BAK: -------------------------------------------------------------------------------- 1 | /*prg to demonstrate gets and puts */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | char str[20]; 7 | clrscr(); 8 | printf("\n Enter any string"); 9 | gets(str); 10 | printf("\n Entered string is "); 11 | puts(str); 12 | 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M13.C: -------------------------------------------------------------------------------- 1 | /*prg to demonstrate gets and puts */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | char str[20]; 7 | clrscr(); 8 | printf("\n Enter any string"); 9 | gets(str); 10 | printf("\n Entered string is "); 11 | puts(str); 12 | 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M13.CPP: -------------------------------------------------------------------------------- 1 | /*program to check whether given year is a leap year or not using 2 | conitional operator*/ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int year; 8 | clrscr(); 9 | cout<<"enter the year"; 10 | cin>>year; 11 | (year%4==0)?cout<<"\n Leap Year ":cout<<"\n Not a leap year"; 12 | 13 | getch();} -------------------------------------------------------------------------------- /M14.BAK: -------------------------------------------------------------------------------- 1 | /*prg to demonstrate getchar and putchar */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | char ch; 7 | clrscr(); 8 | printf("\n Enter any character"); 9 | ch=getchar(); 10 | printf("\n Entered character is "); 11 | putchar(ch); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M14.C: -------------------------------------------------------------------------------- 1 | /*prg to demonstrate getchar and putchar */ 2 | #include 3 | #include 4 | void main() 5 | { 6 | char ch; 7 | clrscr(); 8 | printf("\n Enter any character"); 9 | ch=getchar(); 10 | printf("\n Entered character is "); 11 | putchar(ch); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M16.CPP: -------------------------------------------------------------------------------- 1 | /*program to demo decrement operator*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=10,j=20; 7 | clrscr(); 8 | cout<<"\n value of i"< 3 | #include 4 | void main() 5 | { 6 | float a,b,c,sum,avg; 7 | clrscr(); 8 | printf("\n Enter three nums"); 9 | scanf("%f%f%f",&a,&b,&c); 10 | sum=a+b+c; 11 | avg=sum/3; 12 | printf("\n sum of 3 nums=%f",sum); 13 | printf("\n average of 3 nums=%f",avg); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /M17.C: -------------------------------------------------------------------------------- 1 | /*prg to find sum and avg of 3 nums*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | float a,b,c,sum,avg; 7 | clrscr(); 8 | printf("\n Enter three nums"); 9 | scanf("%f%f%f",&a,&b,&c); 10 | sum=a+b+c; 11 | avg=sum/3; 12 | printf("\n sum of 3 nums=%f",sum); 13 | printf("\n average of 3 nums=%f",avg); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /M17.CPP: -------------------------------------------------------------------------------- 1 | /*program to find biggest of two nums using simple if*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=30,j=20; 7 | clrscr(); 8 | if(i>j) 9 | cout<<"\n\t"< 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | cout<<"\n Enter any no"; 10 | cin>>n; 11 | if(n>0) 12 | cout<<"\t"< 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | cout<<"\n Enter any no"; 9 | cin>>n; 10 | if(n%2==0) 11 | cout<<"\n\t"< 7 | #include 8 | main() 9 | { 10 | clrscr(); 11 | printf("\n \t All"); 12 | printf("\n \t the"); 13 | printf("\n \t best"); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /M2.C: -------------------------------------------------------------------------------- 1 | /*prg to print message 2 | all 3 | the 4 | best 5 | */ 6 | #include 7 | #include 8 | main() 9 | { 10 | clrscr(); 11 | printf("\n \t All"); 12 | printf("\n \t the"); 13 | printf("\n \t best"); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /M2.CPP: -------------------------------------------------------------------------------- 1 | //prg to display a simple message 2 | #include 3 | #include 4 | void main() 5 | { 6 | clrscr(); 7 | cout<<"All"< 3 | #include 4 | #include 5 | void main() 6 | { 7 | float n,sq; 8 | clrscr(); 9 | printf("\n Enter any no"); 10 | scanf("%f",&n); 11 | sq=sqrt(n); 12 | printf("\n square root of a given no =%0.2f",sq); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M20.C: -------------------------------------------------------------------------------- 1 | /*prg to find the square root of a given no*/ 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | float n,sq; 8 | clrscr(); 9 | printf("\n Enter any no"); 10 | scanf("%f",&n); 11 | sq=sqrt(n); 12 | printf("\n square root of a given no =%0.2f",sq); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M21.C: -------------------------------------------------------------------------------- 1 | /*prg to find m^n of given num using math function*/ 2 | #include 3 | #include 4 | #include 5 | void main() 6 | { 7 | int m,n,res; 8 | clrscr(); 9 | printf("\n Enter the value of m and n"); 10 | scanf("%d%d",&m,&n); 11 | res=pow(m,n); 12 | printf("\n m^n of given num =%d",res); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M23.C: -------------------------------------------------------------------------------- 1 | /*prg to calculate simple interest*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int p,t; 7 | float r,si; 8 | clrscr(); 9 | printf("\n Enter p t r values"); 10 | scanf("%d%d%f",&p,&t,&r); 11 | si=(p*t*r)/100; 12 | printf("\n simple interest =%f",si); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M24.BAK: -------------------------------------------------------------------------------- 1 | //prg to print nums 1 to 10 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | while(i<=10) 9 | { 10 | cout<<"\t"< 3 | #include 4 | void main() 5 | { 6 | float area,b,h; 7 | clrscr(); 8 | printf("\n Enter base and height"); 9 | scanf("%f%f",&b,&h); 10 | area=0.5*b*h; 11 | printf("\n Area of a traingle =%f",area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M24.CPP: -------------------------------------------------------------------------------- 1 | //prg to print nums 1 to 10 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | while(i<=10) 9 | { 10 | cout<<"\n\t"< 3 | #include 4 | void main() 5 | { 6 | int i=10; 7 | clrscr(); 8 | while(i>=-10) 9 | { 10 | cout<<"\n\t"< 3 | #include 4 | void main() 5 | { 6 | float area,b,l; 7 | clrscr(); 8 | printf("\n Enter length and breadth"); 9 | scanf("%f%f",&l,&b); 10 | area=l*b; 11 | printf("\n Area of a rectangle =%f",area); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M25.CPP: -------------------------------------------------------------------------------- 1 | //prg to print nums 10 to 1 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=10; 7 | clrscr(); 8 | while(i>=1) 9 | { 10 | cout<<"\n\t"< 3 | #include 4 | void main() 5 | { 6 | int i=2; 7 | clrscr(); 8 | cout<<"\n"; 9 | while(i<=20) 10 | { 11 | cout<<"\t"< 3 | #include 4 | #define pi 3.142 5 | void main() 6 | { 7 | float area,r; 8 | clrscr(); 9 | printf("\n Enter radius"); 10 | scanf("%f",&r); 11 | area=pi*r*r; 12 | printf("\n Area of a circle=%f",area); 13 | getch(); 14 | } -------------------------------------------------------------------------------- /M26.CPP: -------------------------------------------------------------------------------- 1 | //prg to print nums 1 to 20 even nos 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=2; 7 | clrscr(); 8 | cout<<"\n First 10 even nums are\n"; 9 | while(i<=20) 10 | { 11 | cout<<"\t"< 3 | #include 4 | void main() 5 | { 6 | int a,b,temp; 7 | clrscr(); 8 | printf("\n Enter 2 nums"); 9 | scanf("%d%d",&a,&b); 10 | temp=a; 11 | a=b; 12 | b=temp; 13 | printf("\n After swapping a=%d \t b=%d",a,b); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /M27.BAK: -------------------------------------------------------------------------------- 1 | /*prg to swap two nums using dummy variable*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,temp; 7 | clrscr(); 8 | printf("\n Enter 2 nums"); 9 | scanf("%d%d",&a,&b); 10 | temp=a; 11 | a=b; 12 | b=temp; 13 | printf("\n After swapping a=%d \t b=%d",a,b); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /M27.C: -------------------------------------------------------------------------------- 1 | /*prg to swap two nums using dummy variable*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int a,b,temp; 7 | clrscr(); 8 | printf("\n Enter 2 nums"); 9 | scanf("%d%d",&a,&b); 10 | temp=a; 11 | a=b; 12 | b=temp; 13 | printf("\n After swapping a=%d \t b=%d",a,b); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /M27.CPP: -------------------------------------------------------------------------------- 1 | //prg to print nums 1 to 100 nos which are div by 5 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | cout<<"\n 1 to 100 nums which are div by 5 are:\n"; 9 | while(i<=100) 10 | { 11 | if(i%5==0) 12 | { 13 | cout<<"\t"< 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | while(i<=100) 9 | { 10 | if(i%3==0 && i%5==0) 11 | cout<<"\t"< 3 | #include 4 | void main() 5 | { 6 | int i=1; 7 | clrscr(); 8 | while(i<=100) 9 | { 10 | if(i%3==0 && i%5==0) 11 | cout<<"\t"< 3 | #include 4 | void main() 5 | { 6 | int i=1,fact=1,n; 7 | clrscr(); 8 | cout<<"\n enter any no"; 9 | cin>>n; 10 | 11 | while(i<=n) 12 | { 13 | fact=fact*i; 14 | i++; 15 | } 16 | cout<<"Factorial of a given no="< 3 | #include 4 | void main() 5 | { 6 | int a,b; 7 | clrscr(); 8 | printf("\n Enter any two nums"); 9 | scanf("%d%d",&a,&b); 10 | if(a>b) 11 | { 12 | printf("\n %d is big",a); 13 | } 14 | if(b>a) 15 | { 16 | printf("\n %d is big",b); 17 | } 18 | getch(); 19 | 20 | } -------------------------------------------------------------------------------- /M29.CPP: -------------------------------------------------------------------------------- 1 | //prg to read a no and find factorial a given no 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,fact=1,n; 7 | clrscr(); 8 | cout<<"\n enter any no"; 9 | cin>>n; 10 | 11 | while(i<=n) 12 | { 13 | fact=fact*i; 14 | i++; 15 | } 16 | cout<<"Factorial of a given no="< 7 | #include 8 | void main() 9 | { 10 | clrscr(); 11 | printf("\n All \n The \n Best"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M3.C: -------------------------------------------------------------------------------- 1 | /*prg to print message 2 | all 3 | the 4 | best 5 | */ 6 | #include 7 | #include 8 | void main() 9 | { 10 | clrscr(); 11 | printf("\n All \n The \n Best"); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M30.BAK: -------------------------------------------------------------------------------- 1 | //prg to read a no and find sum of N nos 2 | #include 3 | #include 4 | void main() 5 | { 6 | int i=1,sum=0,n; 7 | clrscr(); 8 | cout<<"\n enter any no"; 9 | cin>>n; 10 | 11 | while(i<=n) 12 | { 13 | sum=sum+i; 14 | i++; 15 | } 16 | cout<<"sum of N nos="< 3 | #include 4 | void main() 5 | { 6 | int i=1,sum=0,n; 7 | clrscr(); 8 | cout<<"\n enter any no"; 9 | cin>>n; 10 | 11 | while(i<=n) 12 | { 13 | sum=sum+i; 14 | i++; 15 | } 16 | cout<<"sum of N nos="< 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | if(n>0) 11 | { 12 | printf("\n %d is +ve no",n); 13 | } 14 | else 15 | { 16 | printf("\n %d is -ve no",n); 17 | } 18 | getch(); 19 | } -------------------------------------------------------------------------------- /M31.C: -------------------------------------------------------------------------------- 1 | /*prg to check whether the given num is +ve or -ve using if-else*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n; 7 | clrscr(); 8 | printf("\n Enter any num"); 9 | scanf("%d",&n); 10 | if(n>0) 11 | { 12 | printf("\n %d is +ve no",n); 13 | } 14 | else 15 | { 16 | printf("\n %d is -ve no",n); 17 | } 18 | getch(); 19 | } -------------------------------------------------------------------------------- /M33.BAK: -------------------------------------------------------------------------------- 1 | /* prg to find the sum of digits*/ 2 | #include 3 | #include 4 | void main() 5 | { 6 | int n,temp,digit,sum=0; 7 | clrscr(); 8 | cout<<"\n enter any num"; 9 | cin>>n; 10 | temp=n; 11 | while(n>0) 12 | { 13 | digit=n%10; 14 | sum=sum+digit; 15 | n=n/10; 16 | } 17 | cout<<"\n Given num is="<>n; 10 | temp=n; 11 | while(n>0) 12 | { 13 | digit=n%10; 14 | sum=sum+digit; 15 | n=n/10; 16 | } 17 | cout<<"\n Given num is="<>a>>b; 10 | cout<<"\n sum="<<(a+b); 11 | cout<<"\n subtraction="<<(a-b); 12 | cout<<"\n product="<<(a*b); 13 | cout<<"\n division="<<(a/b); 14 | getch(); 15 | } -------------------------------------------------------------------------------- /M45.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RashmivernekarN/C-Program/d5dc9720d64d4ab2513c2e93cc458561329c94d9/M45.C -------------------------------------------------------------------------------- /M5: -------------------------------------------------------------------------------- 1 | c -------------------------------------------------------------------------------- /M5.BAK: -------------------------------------------------------------------------------- 1 | //prg to find area of a circle 2 | #include 3 | #include 4 | #define pi 3.142 5 | void main() 6 | { 7 | float ar,r; 8 | clrscr(); 9 | cout<<"Enter radius"; 10 | cin>>r; 11 | ar=pi*r*r; 12 | cout<<"\n Area of a circle="< 3 | #include 4 | #define pi 3.142 5 | void main() 6 | { 7 | float ar,r; 8 | clrscr(); 9 | cout<<"Enter radius"; 10 | cin>>r; 11 | ar=pi*r*r; 12 | cout<<"\n Area of a circle="< 4 | #include 5 | void main() 6 | { 7 | float ar,l,b; 8 | clrscr(); 9 | cout<<"Enter length and breadth"; 10 | cin>>l>>b; 11 | ar=l*b; 12 | cout<<"\n Area of a rectangle="< 3 | #include 4 | void main() 5 | { 6 | float ar,h,b; 7 | clrscr(); 8 | cout<<"Enter base and height"; 9 | cin>>b>>h; 10 | ar=0.5*b*h; 11 | cout<<"\n Area of a triangle="< 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n Enter any num"); 10 | scanf("%d",&n); 11 | (n%2==0)?printf("\n %d is a even no",n):printf("\n %d is a odd no",n); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M8.C: -------------------------------------------------------------------------------- 1 | /*prg to check whether the given num is a even no or odd 2 | using conditional operator */ 3 | #include 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n Enter any num"); 10 | scanf("%d",&n); 11 | (n%2==0)?printf("\n %d is a even no",n):printf("\n %d is a odd no",n); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M8.CPP: -------------------------------------------------------------------------------- 1 | //prg to find area of a traingle 2 | #include 3 | #include 4 | void main() 5 | { 6 | float ar,h,b; 7 | clrscr(); 8 | cout<<"Enter base and height"; 9 | cin>>b>>h; 10 | ar=0.5*b*h; 11 | cout<<"\n Area of a triangle="< 3 | #include 4 | void main() 5 | { 6 | float p,t,r,si; 7 | clrscr(); 8 | cout<<"Enter p t r values"; 9 | cin>>p>>t>>r; 10 | si=(p*t*r)/100; 11 | cout<<"\n Simple Interest="< 4 | #include 5 | void main() 6 | { 7 | int n; 8 | clrscr(); 9 | printf("\n Enter any num"); 10 | scanf("%d",&n); 11 | (n>0)?printf("\n %d is a +ve no",n):printf("\n %d is a -ve no",n); 12 | getch(); 13 | } -------------------------------------------------------------------------------- /M9.CPP: -------------------------------------------------------------------------------- 1 | //prg to find simple interest 2 | #include 3 | #include 4 | void main() 5 | { 6 | float p,t,r,si; 7 | clrscr(); 8 | cout<<"Enter p t r values"; 9 | cin>>p>>t>>r; 10 | si=(p*t*r)/100; 11 | cout<<"\n Simple Interest="<