MGM s JNEC Question Bank Subject: Computer Engineering

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "MGM s JNEC Question Bank Subject: Computer Engineering"

Transcription

1 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 following units is the biggest capacity? a) Byte b) Kilobyte c) Gigabyte d) Megabyte 3 The difference between memory and storage is that the memory is and storage is a) Temporary, permanent b) Permanent, temporary c) Slow, fast d) None of the above 4 Which of the Following holds the ROM, CPU, RAM and expansion cards a) Hard disk b) Floppy disk c) Mother board d) None of the above 5 The language that the computer can understand and execute is called a) Machine language b) Application software c) System program d) None of the above

2 6 Which of the following devices can be used to directly input printed text a) OCR b) OMR c) MICR d) None of the above 7 A floppy disk contains a) Circular tracks only b) Sectors only c) Both circular tracks and sectors d) None of the above 8 Actual executions of instructions in a computer take place in a) ALU b) Control Unit c) Storage unit d) None of the above 9 Which of the following is used as a primary storage device a) Magnetic tape b) PROM c) Floppy disk d) None of the above Answer: b 10 Information retrieval is faster from a) Floppy disk b) Magnetic tape c) Hard disk d) None of the above 11 C is a) An assembly language b) A third generation high level language c) A machine language d) None of the above

3 Answer: b 12 The errors that can be pointed out by the compiler are a) Syntax errors b) Semantic errors c) Logical errors d) None of the above 13 Developer of C is a) Martin Richards b) Ken Thomson c) Dennis Ritchie d) Kernighan 14) After compilation of code, code is obtained to execute the any C program. a) Source, Object b) main, object c) object, main d) object, source 15) unit maintains the co-ordination of computer system. a) ALU b) Memory c) CU d) Hard disk 16 An algorithm is defined as a) a mathematical formula that solves a problem. b) a tempo for classical music played in a coda. c) a logical sequence of a steps to solve a problem. d) a tool that designs computer programs and draws the user interface. 17 What does the diamond shape flowchart symbol represent? a) input/output b) terminal

4 c) decision d) connector 18 Rectangle is used for input and output statement a) True b) False Answer: b 19 Algorithm should be machine independent a)true b)false Symbol is used to represent input and output statement. a) Diamond b) Hexagon c) Rectangle d) Parallelogram Answer: d 21 Documentation section is used to write ---- a) User defined functions b) Library files c) Information about program d) main function is the extension for header file a).header b).h c).txt d).c Answer: b 23 C program statements end up with a) Fullstop b) Comma c) Colon

5 d) Semicolon Answer: d 24 is the extension for C program a).header b).h c).txt d).c Answer: d 25 printf statement is used to displaying string on console a) True b) False 26 stdio.h refers to standard file. a) Standard I/O header b) stabd alone I/O header c) Student I/O header d) all of the above 27 file contains different predefined functions, which are required to run the program. a) IO file b) Header file c) Both a & b d) none of above Answer: b 28 All header files should be included explicitly function. a) before main ( ) b) after main( ) c) anywhere in programmer d) all of the above 29 function is the starting point of the program. a) Any function b) # include()

6 c) main d) all of the above 30 The prototypes of library functions are gathered together into various categories and stored in files. a) Header b) Std I/O c) both a and b d) none of above 31 The of a program is linked with libraries that are needed for execution of a program. a) Object code b) source code c) Object & source code d) any code 32 Scanf ( ) function is the part of header file. a) Conio.h b) input.h c) math.h d) stdio.h Answer: d 33 To user getch( ) in program header file must be included in linking section. a) Conio.h b) input.h c) math.h d) stdio.h 34 Any variable declare before main are called as variables a) Global b) Local c) Both a & b d) Non of above

7 35 The C program structure is in the sequence of a) Documentation,Linking,main function b) Linking,documentation,main function c) documentation,main function,linking, d) none of above 36 process convert source program into object program. a) Linking b) Compilation c) Conversion d) All of the above Answer: b 37 Character constant is declared in --- a) Single quote b) Double quote c) Curly braces d) Round braces 38 Which of the following is not a datatype a) int b) float c) string d) char 39 String constant is declared in --- a) Single quote b) Double quote c) Curly braces d) Round braces Answer: b 40 In C there are --- keywords a) 24 b) 108 c) 32 d) None of above

8 41 are the reserved words whose meaning is already known to compiler. a) Linking b) main function c) Keyword d) None of above 42 are the reserved words whose meaning is already known to compiler. a) Linking b) main function c) Keyword d) None of above 43 is a single alphabet or a digit or a special symbol enclosed in a single quote. a) constant b) variable c) Character constant d) None of above 44 Integer type of data occupies bytes of memory. Constant a) 1 b) 2 c) 4 d) None of above Answer: b 45A character type data occupies bites of memory. Ans: a a) 8 bits b) 4 bits c) 2 bits, d) Any of the above

9 46 symbolic constant is used for new line. a) \t b) \n c) \nl d) None of above Answer: b 47 operators are used to assign the value to variable. a) Assignment b) Mathematical c) both a & B d) None of above Answer : a 48 i++ and ++i will provide the same output. a. True b. False Answer : b 49 To check more than one condition at a time operator is primarily used to check more than two conditions. a. Mathematical b Logical c a & b d none of above Answer : b 50 operators operate on single operand. a. Unit b Logical c. Uniary d. All of above DATA INPUT OUTPUT, DECISION CONTROL AND LOOP CONTROL STRUCTURE

10 1. To print out a and b given below, which of the following printf() statement will you use? float a=3.14; double b=3.14; a. printf("%f %lf", a, b); b. printf("%lf %f", a, b); c. printf("%lf %Lf", a, b); d. printf("%f %Lf", a, b); Ans:- a 2. The single character input/output function are? a. scanf() and printf() b. getchar() and printf() c. scanf() and putchar() d. getchar() and putchar() Ans:-d Ans:-a Ans:-d 3. Precedence determines which operator? a. Is evaluated first b. Is most important c. Is fastest d. Operates on the largest number 4. The two operator && and are? a. Arithmetic operators b. Equality operators c. Logical operators d. Relational operators

11 Ans:-c 5. What will be the output of following code? #include<conio.h> int x=10,y=20; clrscr(); if(x==y) printf( %d%d,x,y); getch(); a. Garbage value b. Raise a error c. Prints nothing d. None of above 6. What is the output of the following program? #include<conio.h> int a=8,b=4; int c,d; clrscr(); c= a>6; d= a>2 && b==3; printf("c = %d, d= %d",c,d); getch(); a. c=1, d=0

12 Ans:- a ans:-c b. c=0,d=1 c. c=0,d=0 d. Compilation error 7. What is the output of the following program? #include<conio.h> int i=10; clrscr(); switch(i) case 1: printf(" i=1"); break; case 10: printf(" i=10"); case 11: printf(" i=11"); break; case 12: printf(" i=12"); getch(); a. i=10 i=11 i=12 b. i=1 i=10 i=11 i=12 c. i=10 i=11 d. none of the above

13 8. What is the output of the following program? #include<conio.h> char c = 'c'; clrscr(); switch(c) case 'a' : printf("inside case a,"); break; case 'b' : printf("inside case b,"); break; case 'c' : printf("inside case c,"); case 'd' : printf("inside case d,"); continue; default: printf("inside default case"); break; getch(); a. inside case c, inside case d b. inside case c c. inside case c, inside case d, inside default case d. Compilation Error Ans:-d 9. How many times "IndiaBIX" is get printed? #include<conio.h> int x; clrscr(); for(x=-1; x<=10; x++)

14 if(x < 5) continue; else break; printf("indiabix"); getch(); a. Infinite times b. 11 times c. 0 times d. 10 times Ans:-c 10. How many times the while loop will get executed if a short int is 2 byte wide? #include<conio.h> int j=1; clrscr(); while(j <= 255) printf("%c %d\n", j, j); j++; getch(); a. Infinite times b. 255 times c. 256 times

15 d. 254 times Ans:-b Ans:-a Ans:-b Ans:-c 11. Which of the following is not logical operator? a. & b. && c. d.! 12. In mathematics and computer programming, which is the correct order of mathematical operators? a. Addition, Subtraction, Multiplication, Division b. Division, Multiplication, Addition, Subtraction c. Multiplication, Addition, Division, Subtraction d. Addition, Division, Modulus, Subtractio 13. Which of the following cannot be checked in a switch-case statement? a. Character b. Integer c. Float d. Enum 14. Give the out put of the following code #include<conio.h> int x=3;

16 float y=3.0; clrscr(); if(x==y) printf("x and y are equal"); else printf("x and y are not equal"); getch(); a. x and y are equal b. x and y are not equal c. x and y are same d. none of above Ans:-a Ans:-a 15. When do we use the case control structure? a. To choose one from multiple alternatives b. To switch from the instruction to another c. To make the execution fast d. None of above 16. What will be the output of the program? #include<conio.h> char suite=3; clrscr(); switch(suite) case 1: printf("all QUIZ");

17 case 2: printf("all Quiz is great"); default: printf("all quiz cintain MCQS"); printf("did you like all quiz?"); getch(); a. All QUIZ b. All quiz is great c. All quiz contains MCQS d. All quiz contains MCQS did you like all quiz? Ans:-d 17. What will be the output of following program #include<conio.h> int c=3; clrscr(); switch(c) case '3': printf("hi"); break; case 3: printf("hello"); break; default: printf("how are u?"); getch(); a. Hi b. Hello c. Hi & Hello

18 d. How are u? Ans:-b Ans:-c 18. What will be the output of following program? #include<conio.h> int i=3; clrscr(); switch(i) case 0: printf("i am Here"); case 1+0: printf("i am in Second case"); case 4/2: printf("i am in third case"); case 8%5: printf("good bye"); getch(); a. All case statements will be executed b. I am Here c. Good bye d. I am in third case 19. What will be the output of the following program? #include<conio.h> int suite=1;

19 clrscr(); switch(suite); case 0: printf("its morning time"); case 1: printf("its evening time"); getch(); a. Error b. Its morning time c. Its evening time d. None of above Ans:-a Ans:-b Ans:-a 20. In a for loop, if the condition is missing,then? a. it is assumed to be present and taken to be false b. it is assumed to be present and taken to be true c. it result in the syntax error d. execution will be terminated abruptly 21. In a for loop, if the condition is missing, then infinite looping can not be avoided by a a. Continue statement b. goto statement c. return statement d. break statement 22. Choose the correct statement a. 0 represent a false condition b. Non zero value represent a false condition

20 c. 1 represent a false condition d. Anything that is not 1, represents a false condition Ans:-a Ans:-d Ans:-d Ans:-a 23. Which of the following comments about for loop are not correct? a. Index value is retained outside the loop b. Index value can be changed from within the loop c. goto can be used to jump,out of loop d. Body of the loop can not be empty 24. Which of the following comment about for loop are correct? a. Using break is equivalent to using a goto that jumps to the statement immediately following the loop b. Continue is used to by pass the remainder of the current pass of the loop c. if comma operator is used,then the value returned is the value of the right operand d. All of above 25. Break statement can be simulated by using? a. goto return exit any of the above statement 26. What will be the output of the following program? int main() int i=2,j=2; while(i+1?--i:j++) printf("i=%d j=%d",i,j); return 0; a. 1,2 b. 1,2

21 0,2 c. 1,2 0,2-1,2 Ans:-a d. 1,2 0,2 0,3 Ans:-b Ans:-a 27. Which of these selection statements test only for equality? a) if b) switch c) Both a & b d) None of the mentioned 28. Which of these are selection statements in Java? a) if() b) for() c) continue d) break 29. Which of the following loops will execute the body of loop even when condition controlling the loop is initially false? a) do-while b) while c) for d) None of the mentioned Ans:-a 30. The keyword break cannot be simply used within: a) do-while b) if-else c) for d) while

22 Ans:-b Ans:-b Ans:-b 31. Which keyword is used to come out of a loop only for that iteration? a) break b) continue c) return d) None of the mentioned 32. Which keyword can be used for coming out of recursion? a) break b) return c) exit d) Both (a) and (b) 33. The output of the code below is a. 0 b. Infinite 0 c. Nothing d. Error Ans:-b #include <stdio.h> int i = 0, k; label: printf("%d", i); if (i == 0) goto label;

23 34. Example of iteration in C. a) for b) while c) do-while d) All of the mentioned Ans:-d Ans:-c Ans:-d 35. Number of times while loop condition is tested is, i is initialized to 0 in both case. while (i < n) i++; do i++; while (i <= n); a) n, n b) n, n+1 c) n+1, n d) n+1, n Which loop is most suitable to first perform the operation and then test the condition? a) for loop b) while loop c) do-while loop d) None of the mentioned 37. What is the output of this C code? #include <stdio.h> int main() for (int i = 0;i < 1; i++) printf("in for loop\n"); a) Compile time error

24 b) In for loop c) Depends on the standard compiler implements d) Depends on the compiler Ans:-c Ans:-d Ans:-d Ans:-a Ans:-d 38. Which among the following is odd one out? a) printf b) fprintf c) putchar d) scanf 39. For a typical program, the input is taken using. a) scanf b) Files c) Command-line d) None of the mentioned 40. The value of EOF is. a) -1 b) 0 c) 1 d) What is the use of putchar()? a) The character written b) EOF is an error occurs c) Nothing d) Both a & b 42. putchar(c) function/macro always outputs character c to the a) screen

25 b) standard output c) depends on the compiler d) Depends on the standard Ans:-b Ans:-c Ans:-b Ans:-a 43. which of the following statement is use to take the control to the beginning of the loop? a. Exit b. Break c. Continue d. None of these 44. A do-while loop is useful when we want that the statement within the loop must be executed? a. Only once b. At least once c. More than once d. None of above 45. What will be the out put of the following program? a. Prints nothing b. Raise an error c. Garbage value d. Allquiz 46. what will be the output of the following program?

26 Int I; For(i=1;i<=5;printf( %d,i)) i++; a. Error b. Garbage values c. 1 to 5 d. Infinite loop Ans:-d 47. what will be the output of the following program? Int x=4; while(x==1) X=x-1; Printf( %d,x); x--;

27 a. 4 b. 1,2,3,4 c. Prints nothing d. None of above Ans:-c Ans:-b 48. What will be the output? Int main() Int k=35; Printf( %d%d%d,k==35,k=50,k>40); a. 35,50,40 b. 0,50,0 c. 0,0,0 d. 1,1,1 49. What will be the output? int a=8,b=4; int c,d; c= a>6; d= a>2 && b==3; printf("c = %d, d= %d",c,d); a. C=1,d=0 b. C=0,d=0 c. C=0,d=1

28 Ans:-a d. Compilation error

MIT Aurangabad FE Computer Engineering

MIT Aurangabad FE Computer Engineering 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. -32768 to

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Adjusted/Modified by Nicole Tobias. Chapter 2: Basic Elements of C++

Adjusted/Modified by Nicole Tobias. Chapter 2: Basic Elements of C++ Adjusted/Modified by Nicole Tobias Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types

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

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

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

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

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

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

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

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: JAVA OPERATORS GENERAL Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

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

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

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

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

Algorithms. Introduction to C. Writing C Programs. Topics

Algorithms. Introduction to C. Writing C Programs. Topics Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs the smallest integer. (Hint: Think about keeping

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

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

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

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

Tutorial No. 1 - Solution (Introduction to Computers & Programming)

Tutorial No. 1 - Solution (Introduction to Computers & Programming) Tutorial No. 1 - Solution (Introduction to Computers & Programming) Computer Programming and Utilization (2110003) 1. Draw a block diagram of computer architecture. 2. List various components of a computer

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

Question 2. Question 3. 0 out of 1 points. The basic commands that a computer performs are, and performance of arithmetic and logical operations.

Question 2. Question 3. 0 out of 1 points. The basic commands that a computer performs are, and performance of arithmetic and logical operations. The basic commands that a computer performs are, and performance of arithmetic and logical operations. input, file Question 2 input, output, storage output, folder storage, directory Main memory is called.

More information

Java Review (Essentials of Java for Hadoop)

Java Review (Essentials of Java for Hadoop) Java Review (Essentials of Java for Hadoop) Have You Joined Our LinkedIn Group? What is Java? Java JRE - Java is not just a programming language but it is a complete platform for object oriented programming.

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

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

Solution Exercise 1.1

Solution Exercise 1.1 Solution Exercise 1.1 Part I Fill in the blanks with the most appropriate answers. 1. A Program is a sequence of step-by-step instructions that a computer executes in order to solve a problem or to perform

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

A Comparison of the Basic Syntax of Python and Java

A Comparison of the Basic Syntax of Python and Java Python Python supports many (but not all) aspects of object-oriented programming; but it is possible to write a Python program without making any use of OO concepts. Python is designed to be used interpretively.

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

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 6: Basic I/O. 6.1 printf

Chapter 6: Basic I/O. 6.1 printf Chapter 6: Basic I/O So far, we've been using printf to do output, and we haven't had a way of doing any input. In this chapter, we'll learn a bit more about printf, and we'll begin learning about character-based

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

Programming Language: Syntax. Introduction to C Language Overview, variables, Operators, Statements

Programming Language: Syntax. Introduction to C Language Overview, variables, Operators, Statements Programming Language: Syntax Introduction to C Language Overview, variables, Operators, Statements Based on slides McGraw-Hill Additional material 2004/2005 Lewis/Martin Modified by Diana Palsetia Syntax

More information

CSCE 111 Exam 1 TRUE/FALSE

CSCE 111 Exam 1 TRUE/FALSE CSCE 111 Exam 1 FORM B TRUE/FALSE 1. Java runs differently on different CPU architectures. F 2. A declared variable is always visible to the entire method in which it is declared. F 3. Because the operator

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

Lecture 2 Notes: Flow of Control

Lecture 2 Notes: Flow of Control 6.096 Introduction to C++ January, 2011 Massachusetts Institute of Technology John Marrero Lecture 2 Notes: Flow of Control 1 Motivation Normally, a program executes statements from first to last. The

More information

Comp181 Midterm Examination, Fall Name Surname: Number: 90 min. 18/11/09

Comp181 Midterm Examination, Fall Name Surname: Number: 90 min. 18/11/09 Comp181 Midterm Examination, Fall 09 10 Name Surname: Number: 90 min. 18/11/09 Answer ALL off the following questions. 1.What does the term hardware refer to? a. The relative difficulty of programming

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

Programming Fundamental. Instructor Name: Lecture-2

Programming Fundamental. Instructor Name: Lecture-2 Programming Fundamental Instructor Name: Lecture-2 Today s Lecture What is Programming? First C++ Program Programming Errors Variables in C++ Primitive Data Types in C++ Operators in C++ Operators Precedence

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

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

The programming language C. sws1 1

The programming language C. sws1 1 The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan

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

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

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

Lecture Set 2: Starting Java

Lecture Set 2: Starting Java Lecture Set 2: Starting Java 1. Java Concepts 2. Java Programming Basics 3. User output 4. Variables and types 5. Expressions 6. User input 7. Uninitialized Variables CMSC 131 - Lecture Outlines - set

More information

A Rudimentary Intro to C programming

A Rudimentary Intro to C programming A Rudimentary Intro to C programming Wayne Goddard School of Computing, Clemson University, 2008 Part 1: Variables and Data-types 1 Getting Started............................... A1 2 Some Basics.................................

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

Outline. Compiling, interpreting, and running. The C Programming Language. Java vs. C. Administrative trivia Goals of the class Introduction to C

Outline. Compiling, interpreting, and running. The C Programming Language. Java vs. C. Administrative trivia Goals of the class Introduction to C Outline ompiling, interpreting, and running Administrative trivia Goals of the class Introduction to 1 2 The Programming Language Java vs. Systems programming language Originally used to write Unix and

More information

Reading Assignment. Main Program in C. K.N. King Chapter 2. K.N. King Chapter 3. K.N. King Chapter 4. K.N. King Chapter 7. Our first C program

Reading Assignment. Main Program in C. K.N. King Chapter 2. K.N. King Chapter 3. K.N. King Chapter 4. K.N. King Chapter 7. Our first C program Reading Assignment Main Program in C In C the main program is a function called main The body of the function is enclosed in left ( ) and right ( ) curly braces. K.N. King Chapter 2 K.N. King Chapter 3

More information

C Syntax and Semantics

C Syntax and Semantics C Syntax and Semantics 1 C Program Structure C Language Elements Preprocessor directives Function Header, and Function body Executable statements Reserved word, Standard identifiers, user defined identifiers

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

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

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

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

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

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

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

High-level programming (Ch 11-14)

High-level programming (Ch 11-14) High-level programming (Ch 11-14) hardware software H/w s/w interface Problems Algorithms Prog. Lang & Interfaces Instruction Set Architecture Microarchitecture (Organization) Circuits Devices (Transistors)

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

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

Introduction to the C++ Programming Language

Introduction to the C++ Programming Language L E S S O N S E T 2 Introduction to the C++ Programming Language PURPOSE PROCEDURE 1. To briefly introduce the C++ programming language 2. To show the use of memory in programming 3. To introduce variables

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

LAB 1 REPRESENTATION OF NUMBERS AND INTRODUCTION TO C

LAB 1 REPRESENTATION OF NUMBERS AND INTRODUCTION TO C LAB 1 REPRESENTATION OF NUMBERS AND INTRODUCTION TO C 1. LAB OBJECTIVE The objective of this lab is to review binary numbers and to review/introduce you to the C programming language and the MATLAB environment.

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

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

Chapter 18 I/O in C. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter 18 I/O in C. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 18 I/O in C Standard C Library I/O commands are not included as part of the C language. Instead, they are part of the Standard C Library. A collection of functions and macros that must be implemented

More information

FORMAT MEANING VARIABLE TYPE

FORMAT MEANING VARIABLE TYPE Printf and Scanf Both formatted I/O Both sent to standard I/O location Printf Converts values to character form according to the format string Scanf Converts characters according to the format string,

More information

MPI and C-Language Seminars 2010

MPI and C-Language Seminars 2010 MPI and C-Language Seminars 2010 Seminar Plan (1/3) Aim: Introduce the C Programming Language. Plan to cover: Basic C, and programming techniques needed for HPC coursework. C-bindings for the Message Passing

More information

OBJECTIVE/MULTIPLE CHOICE QUESTIONS FOR AMIE SECTION A COMPUTING AND INFORMATICS Computer Fundamentals

OBJECTIVE/MULTIPLE CHOICE QUESTIONS FOR AMIE SECTION A COMPUTING AND INFORMATICS Computer Fundamentals OBJECTIVE/MULTIPLE CHOICE QUESTIONS FOR AMIE SECTION A COMPUTING AND INFORMATICS Computer Fundamentals 1. Mnemonic a memory trick is used in which of the following language? c. High level language 2. The

More information

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca

More information

Fundamentals of Programming and Software Development Lesson Objectives

Fundamentals of Programming and Software Development Lesson Objectives Lesson Unit 1: INTRODUCTION TO COMPUTERS Computer History Create a timeline illustrating the most significant contributions to computing technology Describe the history and evolution of the computer Identify

More information

Control Structure. Pseudocode: Input number If number is even Then Print even Else print odd. Flowchart: Begin. End. Print Odd. number even?

Control Structure. Pseudocode: Input number If number is even Then Print even Else print odd. Flowchart: Begin. End. Print Odd. number even? Control Structure Normally, a program is executed in a sequential manner.however, in many cases, a program has to choose among alternative statements C++ provides constructs that enable the programmer

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

Control structures: Conditionals

Control structures: Conditionals Control structures: Conditionals Leo Ferres Department of Computer Science Universidad de Concepción leo@inf.udec.cl April 5, 2011 1a 1 Controlling the flow of a program: if... then... else In order to

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

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Exam Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) The JDK command to compile a class in the file Test.java is A) java Test.java B) java

More information

CLEVELAND INSTITUTE OF ELECTRONICS A FIRST BOOK OF ANSI C, FOURTH EDITION LESSONS 9201C TO 9210C

CLEVELAND INSTITUTE OF ELECTRONICS A FIRST BOOK OF ANSI C, FOURTH EDITION LESSONS 9201C TO 9210C CLEVELAND INSTITUTE OF ELECTRONICS A FIRST BOOK OF ANSI C, FOURTH EDITION LESSONS 9201C TO 9210C 0 Study Guide to accompany A First Book of ANSI C, Fourth Edition By Gary J. Bronson ISBN: 1418835560 ISBN

More information