You are on page 1of 34
Chapter-Wise Past Papers 10 Computer Board Punjab 2023 Prepared By Arbab Pervez Composition — Umar Yaqoob Editor Muhammad Bilal moms LEARNING? 2S ol lg AE wp silas F vgubal gol ely7 csr aces Bod Au! Cailes Cag Sylow 25 Ca}g Ly 03434705026 www.EasyLearningHome.com Contents Gps S Baal Sy (1 nen BG SDH (2 Gh aye (3 at 4 su (5 s EASYLEARNINGHOME.COM SUBJECTS FREE RESOURCES FACILITIES "Mathematics "Video Lectures © Study from home prbystes eoeline Quis * No time constraints Chemistry * Animations “Biology *Chapter-wise Past Papers No fee / charges English hNotes + No advertisements sCompuler Eaiuriafamend * Free to download ‘More... ‘Test generators forteachers. | * Free to share More Subjects and Resources for intermediate students coming soon www.EasyLearningHome.com 3 1) Sy 6 Kral Sop Multiple Choice Questions A float uses bytes of memory: 3 5 A\list of words that are predefined and must not be used by the programmer to name his own variables are known as: Auto words Reserved words Restricted words Predefined words A software that facilitates programmers in writing computer programs is known as An editor An IDE Acompiler ‘A debugger Avalid character constant is: 12 1.2 v c Every programming language has its building blocks and follow some grammar rules called Programming rules Building Blocks ‘Syntax Semantic Rules Include statements are written in section. Header Main Comments Print Polig ied firth ed chee 4 tes oe id FE An IDE wade 2u UP be BOR BS, 2 ir UP gla l weil Al, a / Uri Ltadig ue pe be Ju Biug aa be ot Include statement okt ef -BasyLearningHome .com Single line comments start with: ome aniipu™ fue /* J /* fe Ife t/ *// il «// The statements enclosed inside form the body of the function. <> {} Q 0 The values that do not change during the whole execution of the program are called variables constant stings comments There are types of comments in C- language. 2 3 4 5 Which of following is True about C- Language: Cis notacase sensitive Language —_as variable names All logical Operator are None of these Binary Operators Which of the following is a valid character in C language? ‘Age’ "Age" oe ¢ Which of the following is a valid line of code: int =20 Line =This is a line =n None of these Keywords can be used wai AF ca 2 3 4 3 teen £0 Language Pe AMG Epler 2 Sy ss a Pe VU gut Yet ‘Age’ "Age" Mg ‘gf ob ty int =20 Line =This is a line www.EasyLearningHome.com Which of the following is not a reserved Break If Small Which of the following keyword used for store integer data type: chart int void float are the values that do not change during the whole execution of program: Variable Constant String Commenis is a software that is responsible for the conversion of program files to machine understand and executable code: Compiler IDE Editor Debugger Short Questions Define a variable. Can a program with syntax errors be compiled? Define Character Constant. Define constants. Explain different types of constants. Define Header Section. Define IDE. Define Integer. Define Keyword? wr2023 VF tee Auto Break If ‘Small cede Se LES ia a e float chart int void LAL hy eyed f bx of varia) by kwh dt FS FE kA IDE ns La PEE Coy Prey I uma ue Aut ph, ut aPS uf a7 SIDE ta SA -BasyLearningHome .com Define Reserve words. Define Syntax error. Define the binary operators with example. Describe the purpose of a compiler. Differentiate between constant and Variable? Differentiate between Variable and constant. Enlist eight keywords in C Programming language. Explain int and float type in C-Language How a header file is included in a C program, Identify the errors of this code: jinta [3={2,3,4} Trace the error of the following statement. |# include stdio. h What are header files? What are input / output functions? Explain printf () with examples. What is constant? What is difference between Char and Int? What is integrated development environment? What is meant by body of main ( ) function? HPS sn 2s Lf Nea PE CU Saute tt ke BAP al E35 £0 Programming language iit ; FT Ue at jinta [3={2,3,4} US Pe igs |# include stdio. h printf () Fertive UI F Salle Se GAY A int ss! chart Se rot eA ood Seip Ce SAE main) www.EasyLearningHome.com What is meant by computer programming? What is meant by IDE? What is meant by variable declaration? What is meant by variable initialization? What is syntax error? What is text editor? What is the difference between variable and constants? What will be the output of the following code? float height=5,8 ; printf ("height=% 2f ", height) ; Who is programmer? Why do we need a programming environment? Write any, two Reserve Words in C - Language Write down any four keywords Write down any two rules of Naming Variables. Write syntax of array declaration. Write the purpose of comments in "C* language. Write the syntax to declare a float variable. Write truth table for OR operator. 7 Teeige Seolp fe IDE float height=5,8 ; printf ("height=% 2£ ", height) ; § wf pitrz ferret ptig Se baud ene Ceran Bis, o wi Foe Eb He EF tS Of Seine SL zt tn Sas we LS Biles whe ov! 0B atl Ane SPO Abed SEH" HF 13 COR operator www.EasyLearningHome.com Long Questions Define debugging. How many types of errors can occur in a program? Describe briefly. Define program. Write a detailed note on the structure of C-Program. Define variable declaration and variable initialization write general syntax, also give four examples of valid variable declaration Describe the structure of program in C- Language What are constants? Describe types of constants? What is Integrated Development Environment (IDE)? Write the IDEs for C- Language. What is meant by comments in C Program? Describe purpose and types of ‘comments. What is meant by data types of variables? Describe different data types of variables. Why do we use comments in programming and also define its types so02073 EP E Ap hg ul aZ 6H aor tints wt dp oS ¢4i, & Language ~ C wus he (IS et su fo Lb cre YUH erases ZF s0pp 2 ep Vou” ures s EASYLEARNINGHOME.COM SUBJECTS FREE RESOURCES “Mathematics "Video Lectures “Physics "Online Quiz Chemistry 3 iology “English “Computer Entertainment More... “Test generators for teachers ise Past Papers FACILITIES = Study from home = No time constraints * No fee / charges * No advertisements © Free to download © Free to share More Subjects and Resources for Intermediate students coming soon 9 2) CAS sELjq2 Multiple Choice Questions For initializing a variable, we use the oxsoss operator Sass @ * @ =y 2 2 Format specifier % i shows the data type: swrzoz eI PSU ee eet int float int float char void char void getch( ) is used to take AS INPUL ipo SIA LA og yi— = bb geteh () from user. ae te ter int float int float char All of these char All ofthy printf() is used to print type of gawoes te Peer db LL Sar tie eprint date ‘Sona int float int float char all of these char all of these Scanfis a C-Programming ——sazoze language. sare Operator Escape sequence Funetion Statement terminator Symbol of assignment operator is evesess # =! #4 Symbol of logical AND operation is uxwss ek SAT AND BI & 88 & && ll | i | www.EasyLearningHome.com 10 Symbol used for single Line Constant “ Pt Le The operator 100% is used to calculate: Temes Remainder ‘Square Percentage Factorial The step to divide large problem into smaller problems Divide and conquer Searching a Prblem Dividing a problem Analyzing a problem There are types of logical operators in C-Language. 2 3 4 5 Which is an escape sequence used in C- Language? wn w \g \p Which of following is not a logical operator? AND OR OR NOT Which of the following format specifier is used for : Which of the following is not type of operator: Arithmetic operator Check operator Relational Operator Logical Operator te dedi 2 Cee fj Shr Se a ai eL Livld db REM Ee tot Se_ sequence \n \w \@ \P heh Bs fe et AND OR oR NOT terre www.EasyLearningHome.com Which operator has the highest precedence among the following 0) = Which operator has the lowest precedence among the following? + - Short Questions Define Getch( )function. Define assignment operator. Define binary Operator. Define logical operators. Explain the types of logical operators. Define printf () function. Define short circuiting, Differentiate between built in and user defined functions. Differentiate between unary operator and binary operator. Find the errors in following code int a, b=13; b= ag 2; print£ ("Value of b :% d, b); Find the errors in the following code: void fun(int x, ) x=20; y=10; } {Fie igs wat bas int a, b =13 b= ab 2; printf ("Value of b b); a, wt Fe hE Bo void fun(int x, ) x=20; y=10; } www.EasyLearningHome.com 12 Find the errors in the given code. int a; scanf("$d",a) ; Find the result of given expression. 25/5%3 — (2-1) Find the result of the following expression T+4+(9+2) Find the result of the following expression: 3 — 3 + 9%2/(3 — 2) Solve the following expression. 25% 324 Trace the error of the following code: printf ( I live in Lahore). What are built in function? What is meant by built-in functions? What is modulus operator? What is NOT Operator? Draw its Truth Table. What is the difference between assignment '=' operator and equal to operator? What is the purpose of "\n"? What is the purpose of a modulus operator. Give an example. What is the use of scanf () function? WME Es int a; scan£("%d", a); et oe Link 25/5%3 — (2—1) giles wee on OF Boe T+4(9+2) Som te A Bon 3—3+9%2/(3—2) PLA A Bee #25 So Bowe at iY AE BG printf ( I live in Lahore) . wkbL Ube het Sete ad uh 2 Sy CIS eS RATNOT Se ween" Ue Line st Tuk Se Ube (6 scanfO function www.EasyLearningHome.com 13 What will be the output of the following code: int a =4*3/ (5+1) 784; printf ("Value of b is: % a,b) ; Why logical operators are used in C- language? Write down the output of the following code: int a =4,b float c=2,3; bec # a; print£("’ d", b); Write down the output of the following code: int a=3*5/(2+3)+7%2: printf ("Pakistan") Write down the output of the following code: void main ( ) { printf ("Name: Raza"); "All in fname : } Write the name of any two operators which use in "C". Write the out put of the following code int \ a =4,b float c=2,3; bec * a ; print£ $("% a", bi Write the output of the following code: print f ("Hello\n World") xna023 se Voges SUB be aint a =4*3/ (541) 7%4; printf ("Value of b is: % d, b) ; San Ne Oe int a =4,b float c=2,3; ta; printf ("t d", b); wf aint a=3*5/(2+3)+7%2: printf ("Pakistan") a est Sif bon SE wt ogest Si ben void main ( ) { printf ("Name: Raza"); "All in fname : + thr af bs Gus int \ a =4,b float c=2,3; b=c * a ; printf $("% a” b): So eget CE Bs print £ ("Hello\n World") www.EasyLearningHome.com 14 Write the output of the following code: |print£("1\n2\n3") Write the purposes of Escape sequence. Write the uses of getch ( ) function. Long Questions Describe Arithmetic operators and Relational Operators. Explain the use of printf () and Scanf ( ) functions with examples in C-language. What are logical operators? Discuss types of logical operators. What are operators? Explain assignment operator and arithmetic operators. What are relational operations? Explain with example. What is escape sequence? Explain any two escape sequence with examples. What is operator? Explain the Unary and Binary Operator with examples. ‘suze ede Sky SA Siler Pe & at ae printé ("1\n2\n3") “i tfTEes “LS hy 1 € Escape sequence LF oe S16 LF getch() Ute £25 scan gl) stprintf() tf apfissisre. oe Bi Sor tr le Wiad Buy Ce Ute VE gh Us else feria 2W EASYLEARNINGHOME.COM SUBJECTS FREE RESOURCES FACILITIES eMathesmistics pvides. Mestures = Study from home “Physics "Online Quiz asi aearcawawennd "Chemistry "Animations iolegy "Chapter-wise Past Papers No fee shartias “English *Notes * No advertisements “Computer "Entertainment Free to download “More... “Test generators for teachers * Free to share More Subjects and Resou: 1 interme ite students coming www.EasyLearningHome.com 15 3) Ghic bo piss Multiple Choice Questions Conditional logic help in eae Decisions Iterations Traversing All of these How many times "Pakistan’ will be printed ig bs Fpakisian" 2 Lee bits by using the following statement? Bx for (int a =2; a <=10 ; a= comms |for (int a =2; a < =10 ; ate) at2) printf£( "Pakistan") ; printf( "Pakistan") ; one Two wa 2 Four Five de & How many types of control statements sans 2 Fs SO LE are available in C-Language: womanee 1 2 1 2 3 4 3 4 In “if statement, what happens if the oui ren ot 2 Sy PA Cf if'statement condition is false? wrzona Program crashes Index out of bound ete teh, tig bh tet an error a Further code executes Compiler asks to Ce), Fed Hae change conditions a In an if statement, block of statement is ssi ££ Sig E statement ut ifstatement written inside. mee te te () {} oO {} 0 _ a = In If'statement, the condition is enclosed sw tz rh Wi Lo EU Tf statement in soos () (} O {} 0 a ul oe www.EasyLearningHome.com 16 What is the output of the following code? int x =10; if(x > 10) print f ("Wrong") ; ram else print £ ("Correct") ; Wrong Correct Error No Output Which control structure execute the program statements in order? — Relational Receptitional Conditional Sequential Which is not type of control statement, —reozozs Sequential control Selection Control Repitition control Check control Which of following statements will execute? int a=5 if (a < 10) a att; else if (a>4) a-- att; aaj Both A and B None Which of the following is the condition to check a is factor of c? mene atc==0 0% a*c=0 a% o=={ Which of the following options is used for making two way decision? go for ifelse while contrat wx egest SHBG» int x =10; if(x > 10) print £ ("Wrong"); else print £ ("Correct"); Correct No Output Womg Error ru eI Sg he LP US int a=5 if (a < 10) att; else if (a>4) a-- ; at+ a-- Both A and B None be Bveale he tte tur for while control www.EasyLearningHome.com 17 Which of the followings is the condition to imate Bort Gof ehibe check if n is a factor of m: Da 1% m m%n==0 ném== m%n==0 m*n==0 m+n=s me m+n==0 helps to determine the flow of oxwions program. control structure data structure data control program control is the default control structure in C-language. Check Control Sequential Control Relational Control Allof these statements describe the sequence in which statements of program swans should be executed loop conditional sequential All of these is type of selection statement. Array Loop If Allof these Short Questions An “if statement have compulsory "Else" Se ba” Blse” F€ if statement Li Statement? if yes then give the reason. =“ wf ai Define compound statement. poxao2s tt AP Sar 39e Define conditional logic. soo2073 sat oP ar Define flowchart? 002023, tlh Seagsh Define if statement. ean Sg 7 Sif statement Define selection statement vmozz hap Sate fh www.EasyLearningHome.com Draw a float chart of if statement in C- language Find the error in following code: if(a > 10) print£ ("Good") Find the errors in the following code: jint max (int a ; int b ) 1 if(a >b); return a; return b; Find the Errors in the given code : jaf (a> 10) ; Print£( "Hello') ; Identify errors in the following code if (age > 60) printf ("Senior Citizen") 1; if (a % 2!=0) printf ("odd") print f ("ok' int a =: Identity errors in the following code: i€(age>70) ; print("Senior\ Citizen") Identify the error of the following code int x = 5: if (x23); printf ("Good") ~My 8 ¥if statement U% C-language LF ie ee EL oe if(a > 10) |[print£ ("Good") int max (int a ; { if(a > b); return a; int b ) return b; if (a> 10) ; Printf( "Hello') ; iff (age > 60) printf ("Senior Citizen") int a if (a * 21=0) printf ("odd") I print f£ ("ok"); Zr wa eo bee if (age>70) ; print ("Senior\ Citizen") wt be HU bie int x = 5: if (x>3); printf ("Good") www.EasyLearningHome.com 19 Identify the errors in following code. int max (int a; int b) { if (a>bo?; return a; return b; Identify the errors in the following code: if (a 40) printf (PASS) ; Identify the errors in the following code: int m=40 if(m < 33) printf ("PASS") ; List types of contro! statements Trace an error of the following code: if ( { xt; y tt; What is common mistake in a compound statement? Fie Abe SU Ge int b) int max (int a; { if (a>b) ; return a; return b; ie ek UE ben if (a 40 ) printf (PASS) ; int m=40 if(m < 33) printf ("PASS") ; ut Se OF ta boa www.EasyLearningHome.com 20 What is condition? amare Se bn FR What is conditional logic? woxzozs Wr ea What is meant by if-else statement? What is meant by sequential statements? What is nested if statement? What is nested selection structure? What is output of following code? int a=4 4£(a%2==0) print£ ("Even") print£ ("0K") What is the output of given code? int a , b=5 a=atb ; if(a > 8 && b < 8) b=atb; printf ("a=%d,b=%d",a,b) : What is the output of the following code: 4 aint = 45; if(x+20*7==455) printf ("Good Luck") } else printf ("Hope for the Best") } Why do we need conditional statements? Write down the structure of "if else" statement. Write down the structure of nested selection structure. coawa029 Set Po 1 if-else Seti Ve i PE Se ste Ue nested if int a= if (ab2==0) printf ("Even") printf ("OK") int a b=5 aza+b ; if(a > 8 && b < 8) b=atb; printf ("a=td,b=%d",a,b) ; Got tg { int = 45; if (x+20*7==455) printf ("Good Luck") } else printf ("Hope for the Best") } te dnud ear e Je iG 36 8 aubi de i www.BasyLearningHome. com 21 Write down the structure of of if Statement in a C-Program. Write down types of Selection Statements. Write names of selection statements. Write structure of if-else statement. od Write the output of the following code: int x =10; ant y =5; if (xy) ("8a"); printé £ else print £ ("%d", y) au fed 6ifstatemen 2 BF! int x int y if (xy) printf £ ("ed",x); else print £ ("sa", y) s EASYLEARNINGHOME.COM SUBJECTS FREE RESOURCES FACILITIES “Mathematics “Video ecuros i oud eondloans nbysles online Qvis * No time constraints Chemistry * Animations “Biology *Chapter-wise Past Papers No fee / charges English hNotes + No advertisements sCompuler Eaiuriafamend * Free to download ‘More... ‘Test generators forteachers. | * Free to share More Subjects and Resources for intermediate students coming soon www.EasyLearningHome.com 22 A) Gaiany Sips GS Multiple Choice Questions The size of array in this statement jint ag] is 10 9 8 9 Anarray is a structure, Data Control Loop Conditional Array elements are stored at Memory, Location : Contigents Scattered Divided None Each run of a loop is called cycle Iteration Durtaion Test How many times of the word "Pakistan" will be printed by following code |for {int x =1; x < 6; xt+ 2 3 4 5 How many types of loop in C-language? 2 3 4 5 if the size of an array is 50, the range of index will be: 11050" 0to49 0 to 50 1to49 Fan2019 jint a[9] 2 3 4 5 Sate e Se4 # C-language 2 3 4 5 2 0A KIA Sort 4960 soto 49e 1 www.EasyLearningHome.com 23 in [for ( i =1; i < 10; i +4) the initialization part is: is in for i<10 Of the size of an array is 100, the range of indexes will be 0-99 1-100 0-100 2-102 The index of first element of an array is 0 1 2 1 To initialize the array in a single statement, initialize it declaration. at the time of after before AandB Using loop inside a loop is called loop. FOR DO-WHILE WHILE NESTED What is the output of the following code: int b [3] ={15,20,16}; printf ("td", b [2]) 16 17 18 19 What is the output of the following code: int c[2] ={25 30) print£( "8", C [1]) 30 25 24 23 |for (i=l; i< 10; i ++) PAIL 0-99 0-100 1-100 2-102 ete Sate hoon 0 1 2 -l alia tet feu LTP gel wk He UIs Bat at Si ha Eo! FOR DO-WHILE. WHILE NESTED te Pees Soe int b [3] ={15,20,16}; printf ("td", b [2]) ; 16 te 18 19 ae eg est St int c[2] =(25 30} printf£( "%", C [1]) 30 P 2 2% www.EasyLearningHome.com 24 Whish one of the following is the size of VA Clima (5 int arr [5]: ome 4 2 4 2 6 5 6 5 Y will be the value of y Sn led Sy int abe (int); int abe (int); void main( ) { void main( ) { int y=abe(2) ; int yeabe(2) ; print£("td",y); printf ("%d",y); ; wom int abc (intx) int abe(intx) { { return x % 2; return x $ 2; ) ) 3 2 3 1 1 0 is the unique identifier, used to ures IP Ke Re este A) refer to the array: ae Data type Array name Array size None makes iteasier to read and = gavanas write values in array. aes Loop if ifelso nested if part of loop is executed first. ‘son2023, Condition Body initialization Increment/decrement structure allows repetitions J of a set of instructions — Loop Conditional Control Data www.EasyLearningHome.com 25 can be thought of as a container to store constant. Box Jar Variable Collection Short Questions Declare an array of type float that can store 5 values. Write a program using For loop to print word "PUNJAB", 10 times Declare an array of float type to store marks of 30 students Define an array initialization. Define Array. Define data structure? Define Index. Define Loop? Differentiate between array deciaration and array initialization. Find errors in following code : for(int x=0; x <5 print£ ("World") ; ix +) How array is declared in C-Language? How can we access array elements? How can we declare an array of type int? How does to access an element of an array? ALA gS gies -£S Soe LS ee od For we ES sper BietAckb Ei PEW Ee tas SAr is th aP 6 a7 Se! foc Pt bon tS Ie nde BS Boa for(int x=0; x <5 printf ("World") ; Seth SBE Set eI S EL Lore = +) — Language HESS Lf Aint sete LUA US by Le www.EasyLearningHome.com 26 How would you declare and initialize a float type array to store height of seven persons? Is loop a data structure? Explain Trace an error from the syntax of an array. | array-name[array-size] Trace an error of the following code: Vold main( ) { int array [5 } What is counter variable? What is array? What is meant by Array declaration? What is meant by array index. What is meant by array initialization? What is meant by data structure? What is meant by loop structure? What is meant by nested loop? What is the benefit of initializing an array while declaring? What is the output of code? for (int i= 0; i< 3; i +4) { printf ("Pakistan \ n") J eB LE LIE 25 Sure Sf sL gta i Sfen aw bi Bt oe array-name[array-size] io Me Vold main( ) { int array [5 ) bs ous Sep Ve et feu Sep le Mie Tepe te VeAry Sep Leahy ot Sel Pos ee for (int i = 0; i< 3; i ++) { printf ("Pakistan \ n") } www.EasyLearningHome.com 27 What is the output of the following code: $for \ (int Vis l:ii< =10 ; i ++ )S $print f ("\%d \ n",i) : $ Write a program using a for Loop to print counting from 1-10. Write a program using for loop to in C- Language that prints odd numbers from 5 to 15 on the computer screen. Write down the general syntax of array initialization. Write down the name of parts of For loop syntax? Write down the names of the types of loops. Write down the output of the following code segment? int i for ( i=1; I < 10 ; I=I+2) printf ( "*\n); Write output of the following code: for(int a=1l; a < 4; a ++) print ("Hello\n"); Write output of the following code: aint i; for( i=l; i<=5; printf ("8d", i); i +4) Write the flow char of FOR Loop. ‘Swtzozs EU gk ted f10) GbE 15 25 2 wl S98 Si BE Bee Sfor \ (int \ i =1 =10 ; i ++ )$ Sprint £ ("\$\ d \ n",i) $ si aed F for Loop 10 4 1 2 Ae fi eS gen tS Ser phage el S Jub £9 For Ut C language int i; for ( i: I<10; printf ( "*\n); I=1+2) wt wt op est Soe for(int a=1; a < 4; print ("Hello\n") a ++) inta@™; for(i 5; i ++) printf ("sa", i); gf Le 8 © FOR Loop www.EasyLearningHome.com 28 Write the output of the following code: OF cet SW Ben int n; int n; for(n=5; n > print £( "sd for(n=5; n >= 1 ; n+ +) print £( "td", n) ; Write the output of the following output. OF oo SF Btn int ja [J = (1,2,3); int jaf] = {1,2,3}; for (j =0; 5< 3, 4 +4) for (j =0; 3 <3, 5 +4) printf ("td/n", a [ 3 1}; printf ("Sd/n", a [ 3 1}; Write the syntax of array declaration. ia aw K€ LZ Write the use of "for" loop. an a NEI? for Long Questions Write a program using FOR loop that print FORA S 4 Stel first five even numbers. aaah Write a program that print counting from 5 eg tat £1085 Zt LS ee SFOR Loop -10 using FOR Loop. on co heh Write a program to print odd numbers ad U0 1 LA eH 6 for loop from 1 to 10 using for loop. mae ohh Write a program in C-language 1 to 100 numbers on screen Using FOR loop umes Write a program in C-Language that takes = use) Se 2 £47 Hit Ay number from user and prints table of vos of © Ew HE SH Cpt Low fi that number using loop on a screen -ai Sigs Write a program that displays the values eS gy F fle ort hgeti from 10 to 1 on the computer screen Write a program to print"PAKISTAN" ten PAKISTAN" 2 x 2.{UI=1 FOR Loop times on computer screen using FOR 4 ate Sug ti Sry ugar Loop. . Write a program to print digits from 1 to Me LS eS! WHILE... WEND 10 using WHILE.... WEND loop. Efe ire Ha hey www.EasyLearningHome.com 29 Write a program to print sum of first ten thee Lids 2S 62 "FOR" tueseea ee natural number using "FOR" loop. ES oi ok Cid Bud edt Write a program to print the factorial of wl S SL 1° jor” any number using "for" loop. — we NLS, Write a program using FOR loop to print L first five odd number. eae eS i si Ob GL Write a progrom using "for loop" in C- EMELINE for loop "LEMS language that print even number from 40 raz tint tgs & trek £60 oe to 60 on the computer screen. Write down a program using "for" loop to "for" Stal o® £20222 fap hg fi print event numbers for 2 to 20. eawaons wet OY ER ES SH od Write down a program using "for" loop to WenL tT eis ey print odd numbers from 1 to 9. eS tg 190 Ltal s EASYLEARNINGHOME.COM SUBJECTS FREE RESOURCES FACILITIES “Mathematics “Video ecuros i oud eondloans prbystes online Qvis * No time constraints Chemistry * Animations Bieeene “Biology *Chapter-wise Past Papers No fee / charges English hNotes + No advertisements sCompuler Eaiuriafamend * Free to download ‘More... ‘Test generators forteachers. | * Free to share More Subjects and Resources for intermediate students coming soon www.EasyLearningHome.com 5) Multiple Choice Questions A set of multiple statements enclosed in braces is called a box list block job A is a block of statement Which performs a patricular task. Computer Program Funetion Parameter C-Programming language also provide structure to deal with conditions: Tree Fucntions Loop Switch case Char ed{) {return ‘a'}. in this function char" is : Arguments Array Return type Body Function signature consist of : return type all of these function name numbers and type of parameters Functions could be built in or admin defined server defined user defined none of these How many values return by a function: zero one two three ia EH £ AUS 4 C-Programming language etn Wik fro br << "Chan" 4G (char cal) froturn'a err es oh etnne LEE A te OP Supt Pope co » “i » 7 www.EasyLearningHome.com 31 if there are three return statements in the function body, of them will be executed. One Two Three First & Last Inputs of function are called Parameters Return value Function Signature Indentifier Readability help to the code: understand Modify Debug Allof these The values passed to a function are called bodies arrays return types arguments The functions which are available in C- standard library are called: User defined Built -in Recursive Repetitive is the return of this function int isvowel(char) ; isvowel Void char int is a block of statements which performs a particular tasks computer Program Function Parameters describes the name, inputs and outputs of the function. Function Call All Function declaration Function Signature ee Sky LI (ee a bt “A tL ar £bLAUC™ standard oat wk te Veton Seon int isvowel(char) ; isvowel Void char int wih etice Sate __ eeMagn Lyi mick ft Grete Bee Ute www.EasyLearningHome.com 32 means to transfer the anaes conirol to another function. warms Calling Defining Re-Writing Including Short Questions What is the different between function arguments and para meter? What will be the output of the following code? int xyz(int n) int xyz (int n) { { return ntn; return nin; wens |} ) own int main() ; int main(); { 1 aint p=xyz (5); aint p=xyz(5); printf ("%d",p); } print£("d",p); } Define Argument? = Sep Fe ee Define function. a wa SeS Define user-defined functions. emes How function improves the readability of sett x the program? How many values can a function return? —umzoza set Sop ut FF 4 How to cell a function in a main program if £ f<-(Show Program) t ¥7 9 a function name is (Show Program)? ae wt of Pe SELMA Identify Error is the following Program: Se SP teh ties void sum ( int a, int b) void sum ( int a, int b) { fees | [ return atb ; return atb ; } } www.EasyLearningHome.com 33 Trace an error from the following code int add(int x; int y) { int result; result=xty rest result; } What data-type of parameters? What do you know about return keyword? What do you known about function calling? What do you mean by return type of a function? What is argument in function? What is divide and conquer rule? What is function signature? What is meant by problem solving approach? What is meant by arguments? What is meant by function definition? What is meant by parameters? What is meant by readability in advantages of functions? What is meant by return type of a fuction? What is meant by reusability of a function? What is user defined function? wr2023 ‘onwa029 Poe ES Bae int add(int x; int y) { int result; result=xty rest result; y wegen te See fe whit te Se VLE Pe te Ve VW eh SLI Ee ip Vey fa te lp Vow ipa Kg Seaip Ye ele fx LiL tes ve aupte Ses ea Say oS * www.EasyLearningHome.com 34 What will be the output of the following: aint aa(int x) { int p=x/10; return p; } int main ( ) { print £ ("We get 3d", aa(20)) Which approach divides a problem into smaller problem and why? Write a down a function signature, ifa function takes an integer as input and return its square. Write down the two advantages of function? Write general structure of function definition. Write the procedure to call a function Write the types of Function. Sx £ & co S e int aa(int x) { int p=x/10; return p; } int main ( ) { print £ ("We get % a", aa(20)) we SE LIE LEIE V oF SS sul Ort vine Wag Ai iat oi we fe re s EASYLEARNINGHOME.COM SUBJECTS FREE RESOURCES "Mathematics "Video Lectures “Physics “Online Quiz Chemistry "Animations “Biology *Chapter-wise Past Papers *English “Notes *Computer “Entertainment *More... “Test generators for teachers FACILITIES * Study from home = No time constraints = No fee / charges = No advertisements Free to download © Free to share More Subjects and Resources for intermediate students coming soon www.EasyLearningHome.com

You might also like