MIT Aurangabad FE Computer Engineering

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "MIT Aurangabad FE Computer Engineering"

Transcription

1 MIT Aurangabad FE Computer Engineering Unit 1: Introduction to C 1. The symbol # is called a. Header file c. include b. Preprocessor d. semicolon 2. The size of integer number is limited to a to c. 3.4e-38 to 3.4e+38 b to +127 d. none of these 3. Characters usually stored in----byte a.1 byte c. 2 byte b. 4 byte d. none of these 4. A character constant is a single alphabet, a single digit or a single special symbol enclosed in? a. Single quotes c. Floating b. Double quotes d. None of these 5. Comments are. A. Executable statements C. Assignment statements B. Non executable statements D. Input/Output statements 6. Blank spaces are allowed while declaring variable. a. True b. False 7. Which of the following is legal variable name? abc 1, stud_1, view1-a, ans2^3 a. abc 1 b. stud_1 b. view1-a d. ans2^3 8. In C language reading data from keyboard? a. printf() c. scanf() b. int d. main() 9. The real constants could be written in a. Fractional form only c. ASCII form only b. Exponential form d. Both Fractional and Exponential form 10. Which of the following is not valid data type? a. int c. float b. char d. main 11. which of the following is odd one out a. + c. - b. & d. % 12. In a C language && is a?

2 a. Relational operator c. Logical operator b. Arithmetic operators d. None of these 13. Which of the following is not relational Operator a. >= c. * b. == d. < 14. Which of the following is not Logical Operator a. c. < b. && d.! 15. Values of data items of types int, float, char are displayed by writing in printf statement in C A. %d, %f, %s C. %d, %d, %c B. %f, %d, %c D. %d, %f, %c 16. if a=3, b=0 and c=-4, what is the value of the expression a && b c A. 1 C. 3 B. 2 D Basic symbols of flow chart are. A. Start and End C. Input Output B. Processing, Decision D. All of above 18. Diamond shape in flow chart denotes. A. Start C. End B. Decision D. Input - Output task 19. Which of the following is used for representing a Conditional Statement in a Flow chart A. Parallelogram C. Trapezoid B. Rhombus D. Rectangle 20. Amongst the flowchart symbols, which of the following is an Auxiliary symbol? A. Sequence C. Decision B. Connector D. Repetition 1. is used to write the algorithms. A. Computer Language C C. Computer Language C++ B. Any Programming Language D. English Language 21. Algorithm halts in A. Finite time C. Logarithmic time B. Infinite time D. Exponential time 22. C programs are converted into machine language with the help of A. An Editor C. An Operating System B. A Compiler D. An interpreter 23. Which are the types of errors that can occur in a computer program? A. Logical errors C. Both A and B B. Syntax errors D. None of these 24. What is output of following program?

3 #include<stdio.h> #include<conio.h> void main() { int a=7,b=2,c,d; c=a%b; d=a/b; printf( c=%d \n,c); printf( d=%d\n,d); getch(); } a. c=3.5, d=1 c. c=1, d=3 b. c=1, d= d. none of these 25. What is the following program doing? main () { int d = 1; do printf( %d\n, d++); while (d < = 9);} (A) Adding 9 integers (B) Adding integers from 1 to 9 (C) Displaying integers from 1 to 9 (D) None of these

4 Unit 5: Data Input Output, Decision Control and Loop Control Structure: 1. The output of the code below is #include <stdio.h> void main() { int x = 5; if (x < 1) printf("hello"); if (x == 5) printf("hi"); else printf("no"); } a) hi b) hello c) no d) None of the mentioned Answer: (a) 2. The output of the code below is 1. #include <stdio.h> 2. int x; 3. void main() 4. { 5. if (x) 6. printf("hi"); 7. else 8. printf("how are u"); 9. } a) hi b) how are you c) Compile time error d) None of the mentioned Answer: (b) 3. Comment on the following code below 1. #include <stdio.h> 2. void main() 3. { 4. int x = 5; 5. if (true); 6. printf("hello"); 7. } a) It will display hello b) It will throw an error

5 c) Nothing will be displayed d) Compiler dependent Answer: (b) 4. The output of the code below is 1. #include <stdio.h> 2. void main() 3. { 4. int x = 0; 5. if (x == 0) 6. printf("hi"); 7. else 8. printf("how are u"); 9. printf("hello"); 10. } a) Hi c) hello b) how are you d) hihello Answer: (d) 5. The output of the code below is 1. #include <stdio.h> 2. void main() 3. { 4. int x = 5; 5. if (x < 1); 6. printf("hello"); } a) Nothing b) Run time error c) Hello d) Varies Answer: (c) 6. What will be the output of the sample code shown above? void main() { int a=12,b=12; if(a==b) printf( a and b are equal ); } a) 12 c) compile time error b) run time error d) a and b are equal Answer: (d) 7. The output of the code below is(when 1 is entered)

6 1. #include <stdio.h> 2. void main() 3. { 4. char *ch; 5. printf("enter a value btw 1 to 3:"); 6. scanf("%s", ch); 7. switch (ch) 8. { 9. case "1": 10. printf("1"); 11. break; 12. case "2": 13. printf("2"); 14. break; 15. } 16. } a) 1 b) 2 c) Compile time error d) No Compile time error Answer: (c) 8) What is the output of code: 1. #include <stdio.h> 2. int main() 3. { 4. int x = 1; 5. if (x > 0) 6. printf("inside if\n"); 7. else if (x > 0) 8. printf("inside elseif\n"); 9. } a) inside if b) inside elseif c) inside if inside elseif d) Compile time error Answer: (a) 9) What is the output of this C code? a) True c) false b) Compile time error d) Undefined behavior Answer: (c)

7 10) What is the output of this C code? 1. #include <stdio.h> 2. int main() 3. { 4. int x = 0; 5. if (x == 1) 6. { 7. if (x == 0) 8. printf("inside if\n"); 9. else 10. printf("inside else if\n"); 11. } 12. else 13. printf("inside else\n"); 14. } a) inside if b) inside else if c) inside else d) Compile time error Answer: (c) 11) What is the output of this C code? 1. #include <stdio.h> 2. int main() 3. { 4. if (printf("%d", printf("))) 5. printf("we are Happy"); 6. else if (printf("1")) 7. printf("we are Sad"); 8. } a) 0We are Happy b) 1We are Happy c) 1We are Sad d) Compile time error Answer: (d) 12) What is the output of this C code 1. #include <stdio.h> 2. const int a = 1, b = 2; 3. int main() 4. { 5. int x = 1; 6. switch (x) 7. { 8. case a: 9. printf("yes "); 10. case b: 11. printf("no\n");

8 12. break; 13. } 14. } a) yes no b) yes c) no d) Compile time error Answer: (d) 13) The Correct syntax for the ` for ` loop in ` C ` is. A. for(i=1; i<=5 ; i++) C. for(i=1, i<=5, i++) B. for(i=1: i<=5: i++) D. None of the above Answer: (a) 14) Comment on the output of this C code? main() { void fun(); int i=1; while(i<=5) { printf(\"%d\",i); if(i>2) goto here; } } a) Syntax Error : Undefined label 'here' b) No Error, Program run c) 1111 d) 11 Answer: (a) 15) In Do-While loop, statements are executed a. At least once c. both a & b b. More than once d. None of them Answer: (c) 16) Which statement is used to restart the loop skipping rest of the statements in loop? a. For statement c. Continue statement b. goto statement d. break statement Answer: (c) 17) Do-while loop is a. Entry controlled c. Break controlled b. Exit controlled d. None of these Answer: (b) 18) In do-while loop, loop condition is checked at the.

9 a. Beginning of loop c. End of program b. End of loop d. Start of program Answer: (b) 19) In following statement which is not a conditional statement a. break c. If.else b. Do..while d. All of them c. Answer: (a) 20) What is Nested if else statements means a. If else within if else c. only if then if..else b. Continuous if..else d. none of these Answer: (a) 21) The control statement that allows us to make a decision from number of choices is called as. A. if-else C. switch B. for D. do-while Answer: (c) 22) A case in ` switch ` statement is terminated by if control should not fall through the successive cases. A. Break C. ; B. break; D. break Answer: (b) 23) Goto statement is used for. A. Conditional jump only C. both conditional and unconditional jumps B. Unconditional jump only D. None of the above Answer: (b) 24) The Correct syntax for the ` for ` loop in ` C ` is. i. for(i=1; i<=5 ; i++) c. for(i=1, i<=5, i++) ii. for(i=1: i<=5: i++) d. None of the above Answer: (a) 25) If ` a ` is a variable defined in a ` C ` program then &a denotes the. A. content of a C. Both A and B B. address of a D. none of these Answer: (b) 26) getchar() function is used for a. Writing a Character c. Reading a Character b. Explaining a Character d. Printing a Character Answer: (c)

10 Unit 6: Arrays and Functions: Q.1 A function that calls itself is known as a) inline function b) nested function c) Overloaded function d) recursive function Answer: (d) Q.2 The return type of a function that does not have any return type is declared as a) long b) double c) int d) void Answer:( d) Q.3 Parameters passed to a function are separated with a) comma b) semicolon c) colon d) none of the above Answer: (a) Q.4 According to the following statements, select the best suitable statement int x=5,y=3,z; a=add(x,y) a) The function add is called by passing the values b) The function add is called by passing reference c) Both a& b above d )None of the above Answer=(a) Q.5 According to the following code, select the best suitable statement

11 int x=5,y=3,z; A=add(&x,&y) Answer:(b) a) The function add is called by passing the values b) The function add is called by passing reference c) Both a& b above d) None of the above Q.6 The return type of the function cannot be a)void b) main c) int Answer:(b) d) Float Q.7 Every program must have at least function(s). a) 1 b) 2 c) 3 Answer:(a) d) None of the above Q.8 In the function definition, the argument list must always be accompanied with the corresponding data type Answer:(a) a) True b) False Q.9 The value returned by a function is returned to the a) main function b) operating system c) caller function d) called function

12 Answer:(c) Q.10 The function that does not return any data is called as fuction a) void b) recursive c) int d) Float Answer:(a) Q.11 The parameters passed by the caller function are called as the parameters a) actual b) formal c) informal d) reference Answer:(a) Q.12 The parameters received by the called function are called as the parameters a) actual b) formal c) informal d) reference Answer:(b) Q.13 The number of actual and formal parameters a) can be different b) should not be the same c) should be same d) cannot be same Answer:(c) Q.14 The data type of actual and formal parameters a) can be different

13 Answer:(c) b) should not be the same c) should be same d) cannot be same Q.15 The prototype of a function can be written Answer:(c) a) only outside a function b) only inside a fuction c) both inside and outside a function d) only with prefix # Q.16 The prototype of a function should contain the data type of the parameters to be passed to that function Answer:(a) a) True b) False Q.17 The return type of the function and that of the variable accepting the returned value can be different Answer:(b) a) True b) False Q.18 The actual and formal parameters are Answer:(d) a) same variables with different names b) different variables with same memory locations c) different memory locations with same variable names d) different memory locations s with same or different names Q.19 Array is a collection of mixed data types a) True

14 b) False Answer:(b) Q.20 The starting index of an array is always a) 0 b) 1 c) 2 d) None of the above Answer:(a) Q.21 The index of the last element of an array of n elements will be a) n+1 b) n c) n-1 d)none of the above Answer:(c) Q.22 The memory space allocated to the array declared as: int a[10]; Will be bytes a) 10 b) 20 c) 30 d) 40 Answer:(b) Q.23 The memory space allocated to the array declared as: float a[10]; Will be bytes a)10 b) 20 c) 30 d) 40 Answer:(d) Q.24 To access an element of an array the operator is used

15 a) comma b) semicolon c) & Answer:(d) d) square brackets [] Q.25 The 10 th element of an array can be accessed as Answer:(b) a) a[8] b) a[9] c) a[10] d) a[11] Q.26 What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array? a)the element will be set to 0 Answer:(c) b) The compiler would report an error. c) The program may crash if some important data gets overwritten. d) The array size would appropriately grow. Q.27 Which of the following statements are correct about an array? 1:The array int num[26] can store 26 elements 2:The expression num[1] designates the very first element in the array 3: It is necessary to initialize the array at the time of declaration. 4: All of the above a) 1 b) 2 c) 3 d) 4 Answer:(a) Q.28. Maximum number of elements in the array declaration int a[5][8] is Answer:(D) A. 28 B. 32 C. 35 D. 40

16 Q.29 Array subscripts in C always start at a )-1 b) 1 c) 0 Answer:(c) d) Value provided by user Q.30. Set of values of the same type, which have a single name followed by an index is called a) function b) structure c) array d) union Answer:(c) Q.31 An array elements are stored in memory locations Answer: (a) a) sequential b) random c) sequential and random d) None of the above Q.32 What is the maximum no. of dimensions an array in c may have a)2 b)8 c)20 d)50 Answer: (e) e)theoretically no limitation. The only practical limits are memory size and compilers.

MGM s JNEC Question Bank Subject: Computer Engineering

MGM s JNEC Question Bank Subject: Computer Engineering MGM s JNEC Question Bank Subject: Computer Engineering 1. All of the following are examples of computer input units EXCEPT: a) Scanner b) Speaker c) Bar code reader d) Keyboard Answer: b 2. Which of the

More information

1. Constants. 2. Variables. 3. Reserved words or key words. 4. Constants. Character set in C

1. Constants. 2. Variables. 3. Reserved words or key words. 4. Constants. Character set in C Character set in C We should use only the following characters in writing a C program. These characters can be combined to create C words. Alphabet: A, B, C, D.. Z, a, b, c, d..z Numeric digits: 0, 1,

More information

C AND C++ PROGRAMMING

C AND C++ PROGRAMMING C AND C++ PROGRAMMING Bharathidasan University A Courseware prepared by University Informatics Centre Part I - Programming in C Getting Started This courseware is intended to be an introduction to C programming

More information

UNIT-1. C Programming & Data Structures. Introduction to Computers: Computing Environment: Types of Computing Environments:

UNIT-1. C Programming & Data Structures. Introduction to Computers: Computing Environment: Types of Computing Environments: Introduction to Computers: C Programming & Data Structures UNIT-1 A computer system consists of hardware and software. Computer hardware is the collection of physical elements that comprise a computer

More information

C Programming Dr. Hasan Demirel

C Programming Dr. Hasan Demirel C How to Program, H. M. Deitel and P. J. Deitel, Prentice Hall, 5 th edition (3 rd edition or above is also OK). Introduction to C Programming Dr. Hasan Demirel Programming Languages There are three types

More information

Tutorial No. 5 - Solution (Decision Making and Branching)

Tutorial No. 5 - Solution (Decision Making and Branching) Tutorial No. 5 - Solution (Decision Making and Branching) 1. Explain if...if ladder with flowchart [7] The if ladder is a way of putting together ifs together when multipath decisions are involved. A multipath

More information

Which of the following is the correct operator to compare two variables? A. := B. = C. equal D. ==

Which of the following is the correct operator to compare two variables? A. := B. = C. equal D. == Group 1 Question 1. What is the correct value to return to the operating system upon the successful completion of a program? A. -1 B. 1 C. 0 D. Programs do not return a value. Question 2. What is the only

More information

INDEX. C programming Page 1 of 10. 5) Function. 1) Introduction to C Programming

INDEX. C programming Page 1 of 10. 5) Function. 1) Introduction to C Programming INDEX 1) Introduction to C Programming a. What is C? b. Getting started with C 2) Data Types, Variables, Constants a. Constants, Variables and Keywords b. Types of Variables c. C Keyword d. Types of C

More information

Basic C Syntax. Comp-206 : Introduction to Software Systems Lecture 10. Alexandre Denault Computer Science McGill University Fall 2006

Basic C Syntax. Comp-206 : Introduction to Software Systems Lecture 10. Alexandre Denault Computer Science McGill University Fall 2006 Basic C Syntax Comp-206 : Introduction to Software Systems Lecture 10 Alexandre Denault Computer Science McGill University Fall 2006 Next Week I'm away for the week. I'll still check my mails though. No

More information

Indicates the end of data when the number of data is not known in advance Must be distinct from the data but be of the same type

Indicates the end of data when the number of data is not known in advance Must be distinct from the data but be of the same type Program Control Essentials of repetition Loop control variable Counts the number of repetitions in the counter-controlled loop Controls the execution of loop Sentinel value Indicates the end of data when

More information

Pseudocode. Pseudocode. Guide for Pseudocode. Computers in Engineering Pseudocode and C Language Review. Example Pseudocode.

Pseudocode. Pseudocode. Guide for Pseudocode. Computers in Engineering Pseudocode and C Language Review. Example Pseudocode. Computers in Engineering Pseudocode and C Language Review Pseudocode Pseudocode is an artificial and informal language that helps you develop algorithms Pseudocode is similar to everyday English; it is

More information

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: IMPORTANT INSTRUCTIONS: 1. Question Paper in English and Hindi and Candidate can choose any one language. 2. In case of discrepancies in

More information

INTRODUCTION TO FLOWCHARTING

INTRODUCTION TO FLOWCHARTING CHAPTER 1 INTRODUCTION TO FLOWCHARTING 1.0 Objectives 1.1 Introduction 1.2 Flowcharts 1.3 Types of Flowcharts 1.3.1 Types of flowchart 1.3.2 System flowcharts 1.4 Flowchart Symbols 1.5 Advantages of Flowcharts

More information

z = x + y * z / 4 % 2-1

z = x + y * z / 4 % 2-1 1.Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1? A. rem = 3.14 % 2.1; B. rem = modf(3.14, 2.1); C. rem = fmod(3.14, 2.1); D. Remainder cannot be obtain

More information

CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16

CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16 CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16 Basics of C Remark: Skim Chapters 1 through 6 of Deitel & Deitel. You will notice the following: C is (more or less) a subset of Java. (So, you are

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

FORM 1 (Please put your name, section # (10am- 001/2pm-002, and form # on the scantron!!!!) CS 161 Exam I:

FORM 1 (Please put your name, section # (10am- 001/2pm-002, and form # on the scantron!!!!) CS 161 Exam I: FORM 1 (Please put your name, section # (10am- 001/2pm-002, and form # on the scantron!!!!) CS 161 Exam I: True (A)/False(B) (2 pts each): 1. The following statement is legal: cout >> Hello, my name is

More information

Introduction to C Programming S Y STEMS

Introduction to C Programming S Y STEMS Introduction to C Programming CS 40: INTRODUCTION TO U NIX A ND L I NUX O P E R AT ING S Y STEMS Objectives Introduce C programming, including what it is and what it contains, which includes: Command line

More information

3) Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

3) Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging? Freshers Club Important 100 C Interview Questions & Answers 1) How do you construct an increment statement or decrement statement in C? There are actually two ways you can do this. One is to use the increment

More information

Programming for MSc Part I

Programming for MSc Part I Herbert Martin Dietze University of Buckingham herbert@the-little-red-haired-girl.org July 24, 2001 Abstract The course introduces the C programming language and fundamental software development techniques.

More information

Dept. of CSE, IIT KGP

Dept. of CSE, IIT KGP Programming in C: Basics CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Types of variable We must declare the

More information

Going from Python to C

Going from Python to C Going from Python to C Darin Brezeale December 8, 2011 Python is a high-level, interpreted language. C has many of the same types of programming constructs as in Python: arrays, loops, conditionals, functions,

More information

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (2014-15) ASSIGNMENT / QUESTION BANK (2110003) [F.Y.B.E.

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (2014-15) ASSIGNMENT / QUESTION BANK (2110003) [F.Y.B.E. SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (2014-15) ASSIGNMENT / QUESTION BANK Subject: Computer Programming and Utilization (2110003) [F.Y.B.E.: ALL BRANCHES] Unit 1

More information

C programming. Intro to syntax & basic operations

C programming. Intro to syntax & basic operations C programming Intro to syntax & basic operations Example 1: simple calculation with I/O Program, line by line Line 1: preprocessor directive; used to incorporate code from existing library not actually

More information

Punctuation in C. Identifiers and Expressions. Identifiers. Variables. Keywords. Identifier Examples

Punctuation in C. Identifiers and Expressions. Identifiers. Variables. Keywords. Identifier Examples Identifiers and Expressions CSE 130: Introduction to C Programming Spring 2005 Punctuation in C Statements are terminated with a ; Groups of statements are enclosed by curly braces: { and } Commas separate

More information

GTU Questions. Computer Programming & Utilization. Chief Course Coordinator Prof. Mitul K.Patel. (Head of Department & Assistant Professor)

GTU Questions. Computer Programming & Utilization. Chief Course Coordinator Prof. Mitul K.Patel. (Head of Department & Assistant Professor) GTU Questions Computer Programming & Utilization Chief Course Coordinator Prof. Mitul K.Patel (Head of Department & Assistant Professor) Course Coordinator Prof. Vrutti D. Shah (Assistant Professor) Lab

More information

14 MAKING DECISIONS IN C

14 MAKING DECISIONS IN C 14 MAKING DECISIONS IN C 14.1 INTRODUCTION So far we have seen that in C programs the instructions are executed in the same order in which they appear in the program. Each instruction is executed once

More information

ROUND 2 (2 ND YEAR) a) Yes b) No c) Depends on the compiler d) Depends on the standard

ROUND 2 (2 ND YEAR) a) Yes b) No c) Depends on the compiler d) Depends on the standard ROUND 2 (2 ND YEAR) 1) Find the output? 2. void 3. 4. int x = 1, z = 3; 5. int y = x

More information

BSc (Hons) Computer Science with Network Security, BSc (Hons) Business Information Systems, BSc (Hons) Mathematics & BSc (Hons) Software Engineering

BSc (Hons) Computer Science with Network Security, BSc (Hons) Business Information Systems, BSc (Hons) Mathematics & BSc (Hons) Software Engineering BSc (Hons) Computer Science with Network Security, BSc (Hons) Business Information Systems, BSc (Hons) Mathematics & BSc (Hons) Software Engineering Cohort: BCNS/07/FT- BIS/07/FT- BIS/06/FT -BM/07/FT BSE/07/FT/PT-

More information

Variables and constants linked with operators. Uses relational and logical operators Evaluates to 1 or 0 (true or false) only

Variables and constants linked with operators. Uses relational and logical operators Evaluates to 1 or 0 (true or false) only Expressions 1 Expressions Variables and constants linked with operators Arithmetic expressions Uses arithmetic operators Can evaluate to any value Logical expressions Uses relational and logical operators

More information

C Programming Laboratory

C Programming Laboratory Sheet 1 of 14 LAB 1: Introduction to C Environment Objective: In this laboratory session you will learn: 1. How to create C programs 2. How C programs are organised 3. How to write a basic program to display

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Common to: CSE 2 nd sem IT 2 nd sem Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart

More information

PE1 Worksheet. 3) What are the three control structures for writing an algorithm in pseudocode?

PE1 Worksheet. 3) What are the three control structures for writing an algorithm in pseudocode? PE1 Worksheet Problem solving 1) What are the four stages of problem solving by programming? What shall be done in each stage? Stage 1: Stage 2: Stage 3: Stage 4: 2) What is the top-down design strategy

More information

Senem Kumova Metin & Ilker Korkmaz 1

Senem Kumova Metin & Ilker Korkmaz 1 Senem Kumova Metin & Ilker Korkmaz 1 A loop is a block of code that can be performed repeatedly. A loop is controlled by a condition that is checked each time through the loop. C supports two categories

More information

Branching. We ll continue to look at the basics of writing C++ programs including. Overview

Branching. We ll continue to look at the basics of writing C++ programs including. Overview Branching Overview We ll continue to look at the basics of writing C++ programs including Boolean Expressions (need to know this before we can using branching and looping!) Branching J.S. Bradbury CSCI

More information

BHARATHIAR UNIVERSITY: COIMBATORE CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++ LANGUAGE

BHARATHIAR UNIVERSITY: COIMBATORE CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++ LANGUAGE Certificate in Advanced Programming - C++ Language Page 1 of 7 BHARATHIAR UNIVERSITY: COIMBATORE 641046 CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Introduction to C Programming

Introduction to C Programming Introduction to C Programming C HOW TO PROGRAM, 6/E 1992-2010 by Pearson Education, Inc. All Rights Reserved. 2.1 Introduction The C language facilitates a structured and disciplined approach to computer

More information

Two-way selection. Branching and Looping

Two-way selection. Branching and Looping Control Structures: are those statements that decide the order in which individual statements or instructions of a program are executed or evaluated. Control Structures are broadly classified into: 1.

More information

Overview of a C Program

Overview of a C Program Overview of a C Program Programming with C CSCI 112, Spring 2015 Patrick Donnelly Montana State University Programming with C (CSCI 112) Spring 2015 2 / 42 C Language Components Preprocessor Directives

More information

Introduction to Programming Block Tutorial C/C++

Introduction to Programming Block Tutorial C/C++ Michael Bader Master s Program Computational Science and Engineering C/C++ Tutorial Overview From Maple to C Variables, Operators, Statements Functions: declaration, definition, parameters Arrays and Pointers

More information

Chapter 2: Problem Solving Using C++

Chapter 2: Problem Solving Using C++ Chapter 2: Problem Solving Using C++ 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common

More information

Control structures in C

Control structures in C Control structures in C Lecture Topics Conditional constructs Iterative constructs Examples Style Lecture materials Textbook 13.3-13.5 Homework None Machine problem MP1.1 due February 2 at 5pm submitted

More information

INTI COLLEGE MALAYSIA

INTI COLLEGE MALAYSIA CSC112 (F) / Page 1 of 5 INTI COLLEGE MALAYSIA CERTIFICATE IN COMPUTING AND INFORMATION TECHNOLOGY PROGRAMME CSC 112 : FUNDAMENTALS OF PROGRAMMING FINAL EXAMINATION : DECEMBER 2002 SESSION This paper consists

More information

3.0 INTRODUCTION 3.1 OBJECTIVES

3.0 INTRODUCTION 3.1 OBJECTIVES Software UNIT 3 CONCEPT IN PROGRAMMING LANGUAGE Structure Page No. 3.0 Introduction 58 3.1 Objectives 58 3.2 Problem, Algorithm, Program and Programming Language 59 3.3 Concept of a Programming Language

More information

Borland C++ Compiler: Hello World Program

Borland C++ Compiler: Hello World Program Introduction Borland C++ Compiler: Hello World Program This article explains how to display text in a console program using the Borland C++ Compiler. The hello program writes Hello World to the console.

More information

Figure 1.12 Entering, Translating, and Running a High-Level Language Program Pearson Education, Inc. All rights reserved.

Figure 1.12 Entering, Translating, and Running a High-Level Language Program Pearson Education, Inc. All rights reserved. Figure 1.12 Entering, Translating, and Running a High-Level Language Program 1 2007 Pearson Education, Inc. All rights reserved. 2 Figure 2.7 General Form of a C Program 2007 Pearson Education, Inc. All

More information

Your first C program. Which one is best?

Your first C program. Which one is best? Your first C program #include void main(void) { printf( Hello, world!\n ); } #include void main(void) { printf( Hello, ); printf( world! ); printf( \n ); } Which one is best? #include

More information

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements 9 Control Statements 9.1 Introduction The normal flow of execution in a high level language is sequential, i.e., each statement is executed in the order of its appearance in the program. However, depending

More information

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE PROGRAMMING IN C CONTENT AT A GLANCE 1 MODULE 1 Unit 1 : Basics of Programming Unit 2 : Fundamentals Unit 3 : C Operators MODULE 2 unit 1 : Input Output Statements unit 2 : Control Structures unit 3 :

More information

GETTING STARTED WITH C++ C++ BASICS - 1 -

GETTING STARTED WITH C++ C++ BASICS - 1 - - 1 - GETTING STARTED WITH C++ Programming is a core activity in the process of performing tasks or solving problems with the aid of a computer. An idealised picture is: PROBLEM COMPUTER SOLUTION Unfortunately

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

The main features of First Generation are:

The main features of First Generation are: MODEL SOLUTION AS -4016 B.Te ch (First Semester) course A INTRODUCTION TO COMPUTER PROGRAMMING ANS 1 : i. Electrically Erasable Programmable Read Only Memory ii. Four Generation iii. c iv. 8 v. High Level

More information

C PROGRAMMING FOR MATHEMATICAL COMPUTING

C PROGRAMMING FOR MATHEMATICAL COMPUTING UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION BSc MATHEMATICS (2011 Admission Onwards) VI Semester Elective Course C PROGRAMMING FOR MATHEMATICAL COMPUTING QUESTION BANK Multiple Choice Questions

More information

Introduction to Computer Science. Programming in C. Dr inŝ. Lidia Jackowska - Strumiłło. Computer Engineering Department TECHNICAL UNIVERSITY OF LODZ

Introduction to Computer Science. Programming in C. Dr inŝ. Lidia Jackowska - Strumiłło. Computer Engineering Department TECHNICAL UNIVERSITY OF LODZ Introduction to Computer Science Programming in C Dr inŝ. Lidia Jackowska - Strumiłło Computer Engineering Department TECHNICAL UNIVERSITY OF LODZ C language features C is a very effective programming

More information

C Programming Language CIS 218

C Programming Language CIS 218 C Programming Language CIS 218 Description C is a procedural languages designed to provide lowlevel access to computer system resources, provide language constructs that map efficiently to machine instructions,

More information

7 Introduction to C++

7 Introduction to C++ 7 Introduction to C++ 7.1 Introduction C++ is an extension to C Programming language. It was developed at AT&T Bell Laboratories in the early 1980s by Bjarne Stroustrup. It is a deviation from traditional

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

C Programming, Chapter 1: C vs. Java, Types, Reading and Writing

C Programming, Chapter 1: C vs. Java, Types, Reading and Writing C Programming, Chapter 1: C vs. Java, Types, Reading and Writing T. Karvi August 2013 T. Karvi C Programming, Chapter 1: C vs. Java, Types, Reading and Writing August 2013 1 / 1 C and Java I Although the

More information

The if-statement. Simple and compound statements. The if-statement comes in two forms: Simple statements:

The if-statement. Simple and compound statements. The if-statement comes in two forms: Simple statements: 1 2 Simple and compound s The if- Simple s: E.g.: expression; Various jumps : break, goto, continue, return. k = a * p + 3; printf("k = %d\n", k); 1 + 2; ; The if- comes in two forms: or E.g.: if (expression)

More information

C A short introduction

C A short introduction About these lectures C A short introduction Stefan Johansson Department of Computing Science Umeå University Objectives Give a short introduction to C and the C programming environment in Linux/Unix Go

More information

Final Exam Review. CS 1428 Fall Jill Seaman. Final Exam

Final Exam Review. CS 1428 Fall Jill Seaman. Final Exam Final Exam Review CS 1428 Fall 2011 Jill Seaman 1 Final Exam Friday, December 9, 11:00am to 1:30pm Derr 241 (here) Closed book, closed notes, clean desk Comprehensive (covers entire course) 25% of your

More information

Chapter One Introduction to Programming

Chapter One Introduction to Programming Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of

More information

Solutions to Assessment: Basic Programming Constructs

Solutions to Assessment: Basic Programming Constructs Solutions to Assessment: Basic Programming Constructs Question 1: Specify the minimum number of comparisons required to find the largest number among a set of 3 integers X, Y and Z. We already know how

More information

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 2: Basic Elements of C++

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with the basic components of a C++ program,

More information

6.087 Lecture 3 January 13, 2010

6.087 Lecture 3 January 13, 2010 6.087 Lecture 3 January 13, 2010 Review Blocks and Compound Statements Control Flow Conditional Statements Loops Functions Modular Programming Variable Scope Static Variables Register Variables 1 Review:

More information

Reading. C Programming Language. Basic syntax Whitespaces. Whitespaces (cont d) #include. Basic syntax Comments

Reading. C Programming Language. Basic syntax Whitespaces. Whitespaces (cont d) #include. Basic syntax Comments Reading C Programming Language Types, operators, expressions Control flow, functions Basic IO K&R Chapter 2 Types, Operators, and Expressions K&R Chapter 3 Control Flow K&R Chapter 7 Basic I/O NEWS Assignment

More information

Arrays and Pointers (part 1)

Arrays and Pointers (part 1) Arrays and Pointers (part 1) EECS 2031 25 September 2016 1 Arrays l Grouping of data of the same type. l Loops commonly used for manipulation. l Programmers set array sizes explicitly. 2 1 Arrays: Example

More information

Basic Common Unix commands: Change to directory d

Basic Common Unix commands: Change to directory d Basic Common Unix commands: cd d Change to directory d mkdir d rmdir d mv f1 [f2...] d mv d1 d2 ls [d] [f...] ls -1 [f...] vi [f] emacs [f] more f cp f1 f2 mv f1 f2 rm f gcc [-o f1] f2 gnuplot Create new

More information

C programming: exercise sheet L2-STUE (2011-2012)

C programming: exercise sheet L2-STUE (2011-2012) C programming: exercise sheet L2-STUE (2011-2012) Algorithms and Flowcharts Exercise 1: comparison Write the flowchart and associated algorithm that compare two numbers a and b. Exercise 2: 2 nd order

More information

12 INPUT AND OUTPUT OF DATA

12 INPUT AND OUTPUT OF DATA 12 INPUT AND OUTPUT OF DATA 12.1 INTRODUCTION In C language input and output of data is done by a collection of library functions like getchar, putchar, scanf, printf, gets and puts. These functions permit

More information

Engineering Problem Solving with C++, Etter/Ingber

Engineering Problem Solving with C++, Etter/Ingber Engineering Problem Solving with C++, Etter/Ingber Chapter 3 Control Structures 1 Control structures Algorithm Development Conditional Expressions Selection Statements Repetition Statements Structuring

More information

Computer Programming Tutorial

Computer Programming Tutorial Computer Programming Tutorial COMPUTER PROGRAMMING TUTORIAL by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Computer Prgramming Tutorial Computer programming is the act of writing computer

More information

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void 1. Explain C tokens Tokens are basic building blocks of a C program. A token is the smallest element of a C program that is meaningful to the compiler. The C compiler recognizes the following kinds of

More information

This exam is to be taken by yourself with closed books, closed notes, no calculators.

This exam is to be taken by yourself with closed books, closed notes, no calculators. Student ID CSE 5A Name Final Signature Fall 2003 Page 1 (12) cs5a This exam is to be taken by yourself with closed books, closed notes, no calculators. Page 2 (33) Page 3 (33) Page 4 (27) Page 5 (40) Page

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

FBCA-02 April-2007 Programming in C Language BCA-102 (New Course)

FBCA-02 April-2007 Programming in C Language BCA-102 (New Course) Seat No. : FBCA-02 April-2007 Programming in C Language BCA-102 (New Course) Time : 3 Hours] [Max. Marks : 70 Instructions : (1) Figures to the right indicate full marks of the question. (2) Make and state

More information

Marathwada Institute of Technology

Marathwada Institute of Technology Marathwada Institute of Technology Master of Computer Application Title of the subject: Object Oriented Programming using C++ Course Code: MCA 101 Faculty: Shubhashree Savant Class: FY MCA Part - I (Question

More information

Model Paper Computer Science Objective. Paper Code Time Allowed: 20 minutes

Model Paper Computer Science Objective. Paper Code Time Allowed: 20 minutes Note: This is Model Paper for guidance of students & teachers. Q. Model Paper Computer Science Objective Intermediate Part II ( th Class) Examination Session -4 and onward Total marks: 7 Paper Code Time

More information

6. Control Structures

6. Control Structures - 35 - Control Structures: 6. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose,

More information

Introduction to C++ Programming

Introduction to C++ Programming Introduction to C++ Programming 1 Outline Introduction to C++ Programming A Simple Program: Printing a Line of Text Another Simple Program: Adding Two Integers Memory Concepts Arithmetic Decision Making:

More information

Objective Type Questions

Objective Type Questions Objective Type Questions Unit- Introduction to computer and programming: Sr.No. Multiple Choice Question Paper Marks Which of the following is a part of primary memory of computer a) PROM b) CD-ROM c)

More information

Tutorial No. 8 - Solution (Strings and User Defined Functions)

Tutorial No. 8 - Solution (Strings and User Defined Functions) Tutorial No. 8 - Solution (Strings and User Defined Functions) 1. Explain strcat( ), strcpy( ),strncmp( ) and strstr( ) string manipulation function. [6] strcat() Function: The strcat function joins two

More information

Programming in C 1. Bharat Kinariwala Tep Dobry. 1 Copyright c1993 by B.Kinariwala and T. Dobry. All rights reserved.

Programming in C 1. Bharat Kinariwala Tep Dobry. 1 Copyright c1993 by B.Kinariwala and T. Dobry. All rights reserved. Programming in C 1 Bharat Kinariwala University ofhawai`i Tep Dobry University ofhawai`i January 5, 1993 1 Copyright c1993 by B.Kinariwala and T. Dobry. All rights reserved. Contents Table of Contents

More information

Programming. MRS.ANURADHA BHATIA M.E. Computer Engineering MSBTE G-SCHEME

Programming. MRS.ANURADHA BHATIA M.E. Computer Engineering MSBTE G-SCHEME Software Engineering MSBTE 2. Project Scheduling G-SCHEME 2015-2016 Programming in C FIRST YEAR SUBJECT CODE 17212 COMPUTER TECHNOLOGY COMPUTER ENGINEERING INFORMATION TECHNOLOGY MRS.ANURADHA BHATIA M.E.

More information

Use the function below for problem #2 Use the function below for problem #3

Use the function below for problem #2 Use the function below for problem #3 1. Which of the following is TRUE regarding arrays? [A]The name of the array represents the first value in the array. [B] The name of the array represents all values found in the array. [C] The name of

More information

Introduction to Java

Introduction to Java Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer About the Tutorial Computer programming is the act of writing computer programs, which are a sequence of instructions written using a Computer Programming Language to perform a specified task by the computer.

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

Standard C Input/Output. Output: printf() Table of Contents

Standard C Input/Output. Output: printf() Table of Contents Standard C Input/Output 1 Output: printf() 2 Table of Contents Output: printf( ) - syntax & sematics Output: printf( ) - examples Output: printf( ) - format control Screen / Printer Control Input: scanf(

More information

C Control Structures. Chapter 13

C Control Structures. Chapter 13 C Control Structures Chapter 13 Cyrus Bazeghi Conditional Control Structures making a decision about which code to execute, based on evaluated expression if Iterative if-else switch executing code multiple

More information

Programming and Data Structures

Programming and Data Structures Programming and Data Structures Tutorial sheet: 2 Topics: Decision Making, Looping and Branching Q 1. (a) What is wrong with the following loop while ( n

More information

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays A First Book of C++ Chapter 2 Data Types, Declarations, and Displays Objectives In this chapter, you will learn about: Data Types Arithmetic Operators Variables and Declarations Common Programming Errors

More information

arrays C Programming Language - Arrays

arrays C Programming Language - Arrays arrays So far, we have been using only scalar variables scalar meaning a variable with a single value But many things require a set of related values coordinates or vectors require 3 (or 2, or 4, or more)

More information

1. A(n) structure is a logical design that controls the order in which a set of statements execute. a. function b. control c. sequence d.

1. A(n) structure is a logical design that controls the order in which a set of statements execute. a. function b. control c. sequence d. Chapter Four MULTIPLE CHOICE 1. A(n) structure is a logical design that controls the order in which a set of statements execute. a. function b. control c. sequence d. iteration 2. The decision structure

More information

Arrays. Arrays, Argument Passing, Promotion, Demotion

Arrays. Arrays, Argument Passing, Promotion, Demotion Arrays Arrays, Argument Passing, Promotion, Demotion Review Introduction to C C History Compiling C Identifiers Variables Declaration, Definition, Initialization Variable Types Logical Operators Control

More information

Chapter 2. Values, Variables, and Types. 2.1 Java Values in DrJava s Interaction Pane

Chapter 2. Values, Variables, and Types. 2.1 Java Values in DrJava s Interaction Pane 14 Chapter 2 Values, Variables, and Types In this chapter we explore the primitive building blocks that are used to develop Java programs. We experiment with the following concepts within DrJava s interactive

More information

Birla Institute of Technology &Science, Pilani Computer Programming (CS F111) Second Semester Lab-3 (Introduction to C Programming Language)

Birla Institute of Technology &Science, Pilani Computer Programming (CS F111) Second Semester Lab-3 (Introduction to C Programming Language) Topics to be covered: 1. C Program structure and execution 2. Data type 3. Reading input and printing output 4. Expression 5. Operator precedency 6. Typecasting Birla Institute of Technology &Science,

More information

Python to C/C++ Fall 2011

Python to C/C++ Fall 2011 Python to C/C++ Fall 2011 1. Main Program Python: Program code is indented after colon : def main(): body of program C/C++: Have more setup overhead. C: Both require #include directives to access libraries

More information

CMSC 106 Lecture Set #2. C language syntax. Syntax vs Semantics Examples

CMSC 106 Lecture Set #2. C language syntax. Syntax vs Semantics Examples CMSC 106 Lecture Set #2 C Language Introduction C language syntax Syntax rules of the grammar vocabulary recognized by the language ANSI standard American National Standards Institute Semantics the meaning

More information