You are on page 1of 8
Easy Notes (Computer 10th) INTRODUCTION TO PROGRAMMING (E-Series) 12 Q.1 Multiple Choice Questions Sr. a Question A 8 c D sofware that facilitates i 1 | programmers. in writing computer | Acompiler | Aneditor | An IDE debugger programs is known as: is a sofware that is responsibve |. {or the conversion of program files to : Fe eee cctedcne eng] Complies | Editor | IDE} Debugger executable code. Every programming language has | Some primitive building blocks and| Programming] ., | Bulling | Semantic follows some grammar rules known} rules ¥ blocks rules asits Ailst of words that are predefined and 44 | Must not be used by the programmer | a 15 worig | Reserved | Restricted | Predefined to name his own variables are known words | words | words J fa ] | made statements are writen @ |v, | an | comments | Pam section are added in the source cade to & | further explain the techniques and | Messages | Hints | Comments | Explanation algorithms used by the programmer. are the values thatdo ot change 7 | during the whole” execution of | Variables | constants | Strings | Comments program, &_| Afloat usés__ bytes of memory. 3 4 3 é 9 | For iniialzing @ variable, we use a a 7 operator. : ee Jar | Variable | Collection Key: 7 z 3 a 5 | 6 7 3 | 0 5 5 c| 8 € these notes are available on taleemcity.com Easy Notes (Computer 10th) _ INTRODUCTION TO PROGRAMMING (E-Series) 13 Q.2 True or False 41) An IDE combines text editors, libraries, compilers and debuggers in a single interface. T/F 2) Computers require the conversion of the code written in program file to machine language in order to execute it. TIF 3) Column is a reserved word in programming language. T/F 4) “comment goes here" is a valid comment. T/F 5) float can store a real number upto six digits of precision. T/F Answers 1 2 3 4 5 T T F F T 3) Define the following. 1)1DE See at page No. 03 2) Compiler See at page No. 05 3) Reserved Words See at page No. 06 4) Main section of a program See at page No. 07 5) char data type See at page No. 09 Q.4 Briefly answer the following questions. 1) Why do we need a programming environment? See at page No. 03 2) Write the steps to create a C program file in the IDE of your lab computer. ‘Ans. The following steps are used to create C program: 4. Open Code Block 2. Click on New Project 3. Click on Console application button 4. Click on GO button 5. Select C language 6. Type a project Name, click on Next Button 7. Click on Finish Button 8. Now you can type your program, 3) Describe the purpose of a compiler. See at page No. 05 4) List down five reserved words in C programming language. See at page No. 06 5) Discuss the main parts of the structure of a C program. See at page No. 06 6) Why do we use comments in programming? ‘See at page No. 07 7) Differentiate between constants and variables. See at page No. 10 these notes are available on taleemcity.com Easy Notes (Computer 10th) _ INTRODUCTION TO PROGRAMMING (E-Series) 14 8) Write down the rules for naming variables. 9) Differentiate between char and Int. 10) How can we declare and initialize a variable? Q5, Match the columns. See at page No. 09 See at page No. 09 See at page No. 10 A B c 1) IDE a) Machine executable code | d) C Lion 2) Text Editor b) Include statement £) Notepad 3) Complier ©) Python a) Machine executable code 4) Programming language | d) C Lion ©) Python 5) Reserved words e) (a+b) 9) struct 6) Link section f) Notepad b) Include statement 7) Body of main {} 9) struct. no 8) Comments my} e) Matb)"/ Exercise 1 + With the help of your teacher open the IDE installed on your lab compute writing C programs. + Write the following program in the editor and save it as ‘welcome.c" #include #include void main() { "A simple C language program"! printf (‘Welcome to C language’): getch(); Output ‘Welcome to C language these notes are available on taleemcity.com Easy Notes (Computer 10th) INTRODUCTION TO PROGRAMMING (E-Series) 15 Exercise 2 Write a program that deciares variables of appropriate data types to store personal data about your best friend. Initialize these variables with the following data: “initial letter of his name “initial letter of his gender “his age “his height Solution: include Output #include int main() { char n="M, g='M’; int age=20; float height=6.1; printf(" %6c %6c %d %F", ng, age , height j getch(); return 0; } MM206.1 oe these notes are available on taleemcity.com Easy Notes (Computer 10th) _ INTRODUCTION TO PROGRAMMING (E-Series) 16 Aetivity 1.4 Use your web browser to find out the names of three different IDEs that can be used for C programming language. : ‘Solution, 1. Eclipse 2. NetBeans 3. Sublime Text Aetivity 12 Open the IDE installed on your lab computer. Write the program that show output "Hello World" in the text editor of your IDE and execute it Solution: #include void main() { print{(‘Hello World”) } Retivity 13 From the following list, encircle the reserved words in C language: int, pack, create, case, return, small, math, struct, program, library. Solution. 1. int 2. case 3. struct 4, retum these notes are available on taleemcity.com Easy Notes (Computer 10th) INTRODUCTION TO PROGRAMMING (E-Series) 17 Aetivity 14 Identify different parts of the following C program: ‘include #include void main() { printf("! am a student of class 10th"); getch(); } ‘Solution. Header files #include #include ‘Main section void main() Body of main function { printf(1 am a student of class 10th" getchi); } Activity 1.5 Tick valid comments among the following: + ‘comment goes here* + feomment goes here! + %comment goes here% +P comment goes here"! + Poomment goes here! + Hcomment goes here */ Solution. Comment goes here*/ these notes are available on taleemcity.com Easy Notes (Computer 10th) INTRODUCTION TO PROGRAMMING (E-Series) 18 ‘Aetivity 16 Identify 2 the type of constant for each of the following values: 42 has 2 32.768 123 an 40.0 fa 1 2 3 4, 5. 6. 7, 8 9 1 0. Solution. integer constant(12) . Real constant(1.2) Character constant() Integer constan'(-21) Real Constant(32.768) Character constant(‘a’) Real Constant (-12.3) Integer constant(41) Real Constant(40.0) Character constant('\') ‘Aetivity 17 Case Encircle the valid variable names among the following. Hello, tvar rollnum = Alr23Blue float Scar name =color Float Hello roll_num name Air23Blue these notes are available on taleemcity.com Easy Notes (Computer 10th) INTRODUCTION TO PROGRAMMING (E-Series) 19 Activity 7 Write a program that declares variables of appropriate data types to store your personal data, initialize these variables with the following data: + initialize letter of your name + initial letter of your gender + your age + your marks in @th class + your height Solution #include #include int main() float height = Printf(" %c %c %d %d %F", ng, age, marks , height ); getch(): return 0; } these notes are available on taleemcity.com

You might also like