MIT Aurangabad FE Computer Engineering

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

VB.NET Programming Fundamentals

VB.NET Programming Fundamentals Chapter 3 Objectives Programming Fundamentals In this chapter, you will: Learn about the programming language Write a module definition Use variables and data types Compute with Write decision-making statements

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

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

Computer Science 2nd Year Solved Exercise. Programs 3/4/2013. Aumir Shabbir Pakistan School & College Muscat. Important. Chapter # 3.

Computer Science 2nd Year Solved Exercise. Programs 3/4/2013. Aumir Shabbir Pakistan School & College Muscat. Important. Chapter # 3. 2013 Computer Science 2nd Year Solved Exercise Chapter # 3 Programs Chapter # 4 Chapter # 5 Chapter # 6 Chapter # 7 Important Work Sheets Aumir Shabbir Pakistan School & College Muscat 3/4/2013 Chap #

More information

C++ Programming Language

C++ Programming Language C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract

More information

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms PROG0101 FUNDAMENTALS OF PROGRAMMING Chapter 3 1 Introduction to A sequence of instructions. A procedure or formula for solving a problem. It was created mathematician, Mohammed ibn-musa al-khwarizmi.

More information

JavaScript: Control Statements I

JavaScript: Control Statements I 1 7 JavaScript: Control Statements I 7.1 Introduction 2 The techniques you will learn here are applicable to most high-level languages, including JavaScript 1 7.2 Algorithms 3 Any computable problem can

More information

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters The char Type ASCII Encoding The C char type stores small integers. It is usually 8 bits. char variables guaranteed to be able to hold integers 0.. +127. char variables mostly used to store characters

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

The C Programming Language

The C Programming Language Chapter 1 The C Programming Language In this chapter we will learn how to write simple computer programs using the C programming language; perform basic mathematical calculations; manage data stored in

More information

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is preceded by an equal sign d. its name has undereline 2. Associations

More information

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)

More information

ALGORITHMS AND FLOWCHARTS

ALGORITHMS AND FLOWCHARTS ALGORITHMS AND FLOWCHARTS A typical programming task can be divided into two phases: Problem solving phase produce an ordered sequence of steps that describe solution of problem this sequence of steps

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

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

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

QUIZ-II QUIZ-II. Chapter 5: Control Structures II (Repetition) Objectives. Objectives (cont d.) 20/11/2015. EEE 117 Computer Programming Fall-2015 1

QUIZ-II QUIZ-II. Chapter 5: Control Structures II (Repetition) Objectives. Objectives (cont d.) 20/11/2015. EEE 117 Computer Programming Fall-2015 1 QUIZ-II Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. (For

More information

MATLAB Programming. Problem 1: Sequential

MATLAB Programming. Problem 1: Sequential Division of Engineering Fundamentals, Copyright 1999 by J.C. Malzahn Kampe 1 / 21 MATLAB Programming When we use the phrase computer solution, it should be understood that a computer will only follow directions;

More information

So far we have considered only numeric processing, i.e. processing of numeric data represented

So far we have considered only numeric processing, i.e. processing of numeric data represented Chapter 4 Processing Character Data So far we have considered only numeric processing, i.e. processing of numeric data represented as integer and oating point types. Humans also use computers to manipulate

More information

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system. http://www.tutorialspoint.com/java/java_quick_guide.htm JAVA - QUICK GUIDE Copyright tutorialspoint.com What is Java? Java is: Object Oriented Platform independent: Simple Secure Architectural- neutral

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

C / C++ and Unix Programming. Materials adapted from Dan Hood and Dianna Xu

C / C++ and Unix Programming. Materials adapted from Dan Hood and Dianna Xu C / C++ and Unix Programming Materials adapted from Dan Hood and Dianna Xu 1 C and Unix Programming Today s goals ú History of C ú Basic types ú printf ú Arithmetic operations, types and casting ú Intro

More information

B.Sc.(Computer Science) and. B.Sc.(IT) Effective From July 2011

B.Sc.(Computer Science) and. B.Sc.(IT) Effective From July 2011 NEW Detailed Syllabus of B.Sc.(Computer Science) and B.Sc.(IT) Effective From July 2011 SEMESTER SYSTEM Scheme & Syllabus for B.Sc. (CS) Pass and Hons. Course Effective from July 2011 and onwards CLASS

More information

About The Tutorial. Audience. Prerequisites. Copyright & Disclaimer

About The Tutorial. Audience. Prerequisites. Copyright & Disclaimer About The Tutorial C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.

More information

Tutorial on C Language Programming

Tutorial on C Language Programming Tutorial on C Language Programming Teodor Rus rus@cs.uiowa.edu The University of Iowa, Department of Computer Science Introduction to System Software p.1/64 Tutorial on C programming C program structure:

More information

Example of a Java program

Example of a Java program Example of a Java program class SomeNumbers static int square (int x) return x*x; public static void main (String[] args) int n=20; if (args.length > 0) // change default n = Integer.parseInt(args[0]);

More information

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser) High-Level Programming Languages Nell Dale & John Lewis (adaptation by Michael Goldwasser) Low-Level Languages What are disadvantages of low-level languages? (e.g., machine code or assembly code) Programming

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Introduction to the C language Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 29, 2012 G. Lipari (Scuola Superiore Sant Anna) The C language

More information

Passing 1D arrays to functions.

Passing 1D arrays to functions. Passing 1D arrays to functions. In C++ arrays can only be reference parameters. It is not possible to pass an array by value. Therefore, the ampersand (&) is omitted. What is actually passed to the function,

More information

C Language Tutorial. Version 0.042 March, 1999

C Language Tutorial. Version 0.042 March, 1999 C Language Tutorial Version 0.042 March, 1999 Original MS-DOS tutorial by Gordon Dodrill, Coronado Enterprises. Moved to Applix by Tim Ward Typed by Karen Ward C programs converted by Tim Ward and Mark

More information

I PUC - Computer Science. Practical s Syllabus. Contents

I PUC - Computer Science. Practical s Syllabus. Contents I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations

More information

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London

More information

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands C Programming for Embedded Microcontrollers Warwick A. Smith Elektor International Media BV Postbus 11 6114ZG Susteren The Netherlands 3 the Table of Contents Introduction 11 Target Audience 11 What is

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

13 Classes & Objects with Constructors/Destructors

13 Classes & Objects with Constructors/Destructors 13 Classes & Objects with Constructors/Destructors 13.1 Introduction In object oriented programming, the emphasis is on data rather than function. Class is a way that binds the data & function together.

More information

Outline. Conditional Statements. Logical Data in C. Logical Expressions. Relational Examples. Relational Operators

Outline. Conditional Statements. Logical Data in C. Logical Expressions. Relational Examples. Relational Operators Conditional Statements For computer to make decisions, must be able to test CONDITIONS IF it is raining THEN I will not go outside IF Count is not zero THEN the Average is Sum divided by Count Conditions

More information

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The

More information

In this Chapter you ll learn:

In this Chapter you ll learn: Now go, write it before them in a table, and note it in a book. Isaiah 30:8 To go beyond is as wrong as to fall short. Confucius Begin at the beginning, and go on till you come to the end: then stop. Lewis

More information

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c Lecture 3 Data structures arrays structs C strings: array of chars Arrays as parameters to functions Multiple subscripted arrays Structs as parameters to functions Default arguments Inline functions Redirection

More information

Flowchart Techniques

Flowchart Techniques C H A P T E R 1 Flowchart Techniques 1.1 Programming Aids Programmers use different kinds of tools or aids which help them in developing programs faster and better. Such aids are studied in the following

More information

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement? 1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members

More information

Answers to Review Questions Chapter 7

Answers to Review Questions Chapter 7 Answers to Review Questions Chapter 7 1. The size declarator is used in a definition of an array to indicate the number of elements the array will have. A subscript is used to access a specific element

More information

Computer Programming Lecturer: Dr. Laith Abdullah Mohammed

Computer Programming Lecturer: Dr. Laith Abdullah Mohammed Algorithm: A step-by-step procedure for solving a problem in a finite amount of time. Algorithms can be represented using Flow Charts. CHARACTERISTICS OF AN ALGORITHM: Computer Programming Lecturer: Dr.

More information

Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl

Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl First CGI Script and Perl Perl in a nutshell Prof. Rasley shebang line tells the operating system where the Perl interpreter is located necessary on UNIX comment line ignored by the Perl interpreter End

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand: Introduction to Programming and Algorithms Module 2 CS 146 Sam Houston State University Dr. Tim McGuire Introduction To Computers And Java Chapter Objectives To understand: the meaning and placement of

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

Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)

Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority) Boolean Expressions, Conditions, Loops, and Enumerations Relational Operators == // true if two values are equivalent!= // true if two values are not equivalent < // true if left value is less than the

More information

Java Interview Questions and Answers

Java Interview Questions and Answers 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

More information

Lexical Analysis and Scanning. Honors Compilers Feb 5 th 2001 Robert Dewar

Lexical Analysis and Scanning. Honors Compilers Feb 5 th 2001 Robert Dewar Lexical Analysis and Scanning Honors Compilers Feb 5 th 2001 Robert Dewar The Input Read string input Might be sequence of characters (Unix) Might be sequence of lines (VMS) Character set ASCII ISO Latin-1

More information

Chapter 13 - The Preprocessor

Chapter 13 - The Preprocessor Chapter 13 - The Preprocessor Outline 13.1 Introduction 13.2 The#include Preprocessor Directive 13.3 The#define Preprocessor Directive: Symbolic Constants 13.4 The#define Preprocessor Directive: Macros

More information

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive

More information

Keil C51 Cross Compiler

Keil C51 Cross Compiler Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation

More information

C++ Language Tutorial

C++ Language Tutorial cplusplus.com C++ Language Tutorial Written by: Juan Soulié Last revision: June, 2007 Available online at: http://www.cplusplus.com/doc/tutorial/ The online version is constantly revised and may contain

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

Visual Logic Instructions and Assignments

Visual Logic Instructions and Assignments Visual Logic Instructions and Assignments Visual Logic can be installed from the CD that accompanies our textbook. It is a nifty tool for creating program flowcharts, but that is only half of the story.

More information

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions Phys4051: C Lecture 2 & 3 Functions (Review) Comment Statements Variables & Operators Branching Instructions Comment Statements! Method 1: /* */! Method 2: // /* Single Line */ //Single Line /* This comment

More information

Exercise 4 Learning Python language fundamentals

Exercise 4 Learning Python language fundamentals Exercise 4 Learning Python language fundamentals Work with numbers Python can be used as a powerful calculator. Practicing math calculations in Python will help you not only perform these tasks, but also

More information

Stacks. Linear data structures

Stacks. Linear data structures Stacks Linear data structures Collection of components that can be arranged as a straight line Data structure grows or shrinks as we add or remove objects ADTs provide an abstract layer for various operations

More information

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459) Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459) Class Time: 6:00 8:05 p.m. (T,Th) Venue: WSL 5 Web Site: www.pbvusd.net/mis260 Instructor Name: Terrell Tucker Office: BDC 127

More information

Basic Java Constructs and Data Types Nuts and Bolts. Looking into Specific Differences and Enhancements in Java compared to C

Basic Java Constructs and Data Types Nuts and Bolts. Looking into Specific Differences and Enhancements in Java compared to C Basic Java Constructs and Data Types Nuts and Bolts Looking into Specific Differences and Enhancements in Java compared to C 1 Contents Hello World Program Statements Explained Java Program Structure in

More information

Pemrograman Dasar. Basic Elements Of Java

Pemrograman Dasar. Basic Elements Of Java Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle

More information

El Dorado Union High School District Educational Services

El Dorado Union High School District Educational Services El Dorado Union High School District Course of Study Information Page Course Title: ACE Computer Programming II (#495) Rationale: A continuum of courses, including advanced classes in technology is needed.

More information

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6) Semantic Analysis Scoping (Readings 7.1,7.4,7.6) Static Dynamic Parameter passing methods (7.5) Building symbol tables (7.6) How to use them to find multiply-declared and undeclared variables Type checking

More information

An Introduction to Assembly Programming with the ARM 32-bit Processor Family

An Introduction to Assembly Programming with the ARM 32-bit Processor Family An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2

More information

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved. 1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays

More information

3/13/2012. Writing Simple C Programs. ESc101: Decision making using if-else and switch statements. Writing Simple C Programs

3/13/2012. Writing Simple C Programs. ESc101: Decision making using if-else and switch statements. Writing Simple C Programs Writing Simple C Programs ESc101: Decision making using if- and switch statements Instructor: Krithika Venkataramani Semester 2, 2011-2012 Use standard files having predefined instructions stdio.h: has

More information

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science I. Basic Course Information RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE CISY 105 Foundations of Computer Science A. Course Number and Title: CISY-105, Foundations of Computer Science B. New

More information

CS1010 Programming Methodology A beginning in problem solving in Computer Science. Aaron Tan http://www.comp.nus.edu.sg/~cs1010/ 20 July 2015

CS1010 Programming Methodology A beginning in problem solving in Computer Science. Aaron Tan http://www.comp.nus.edu.sg/~cs1010/ 20 July 2015 CS1010 Programming Methodology A beginning in problem solving in Computer Science Aaron Tan http://www.comp.nus.edu.sg/~cs1010/ 20 July 2015 Announcements This document is available on the CS1010 website

More information

System Calls and Standard I/O

System Calls and Standard I/O System Calls and Standard I/O Professor Jennifer Rexford http://www.cs.princeton.edu/~jrex 1 Goals of Today s Class System calls o How a user process contacts the Operating System o For advanced services

More information

OpenOffice.org 3.2 BASIC Guide

OpenOffice.org 3.2 BASIC Guide OpenOffice.org 3.2 BASIC Guide Copyright The contents of this document are subject to the Public Documentation License. You may only use this document if you comply with the terms of the license. See:

More information

A brief introduction to C++ and Interfacing with Excel

A brief introduction to C++ and Interfacing with Excel A brief introduction to C++ and Interfacing with Excel ANDREW L. HAZEL School of Mathematics, The University of Manchester Oxford Road, Manchester, M13 9PL, UK CONTENTS 1 Contents 1 Introduction 3 1.1

More information

Moving from C++ to VBA

Moving from C++ to VBA Introduction College of Engineering and Computer Science Mechanical Engineering Department Mechanical Engineering 309 Numerical Analysis of Engineering Systems Fall 2014 Number: 15237 Instructor: Larry

More information

CP Lab 2: Writing programs for simple arithmetic problems

CP Lab 2: Writing programs for simple arithmetic problems Computer Programming (CP) Lab 2, 2015/16 1 CP Lab 2: Writing programs for simple arithmetic problems Instructions The purpose of this Lab is to guide you through a series of simple programming problems,

More information

Computers. An Introduction to Programming with Python. Programming Languages. Programs and Programming. CCHSG Visit June 2014. Dr.-Ing.

Computers. An Introduction to Programming with Python. Programming Languages. Programs and Programming. CCHSG Visit June 2014. Dr.-Ing. Computers An Introduction to Programming with Python CCHSG Visit June 2014 Dr.-Ing. Norbert Völker Many computing devices are embedded Can you think of computers/ computing devices you may have in your

More information

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Duration of Course: 6 Months Fees: Rs. 25,000/- (including Service Tax) Eligibility: B.E./B.Tech., M.Sc.(IT/ computer

More information

Unit 6. Loop statements

Unit 6. Loop statements Unit 6 Loop statements Summary Repetition of statements The while statement Input loop Loop schemes The for statement The do statement Nested loops Flow control statements 6.1 Statements in Java Till now

More information

Translating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language

Translating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language Translation Translating to Java Introduction to Computer Programming The job of a programmer is to translate a problem description into a computer language. You need to be able to convert a problem description

More information

1 Introduction. 2 Overview of the Tool. Program Visualization Tool for Educational Code Analysis

1 Introduction. 2 Overview of the Tool. Program Visualization Tool for Educational Code Analysis Program Visualization Tool for Educational Code Analysis Natalie Beams University of Oklahoma, Norman, OK nataliebeams@gmail.com Program Visualization Tool for Educational Code Analysis 1 Introduction

More information

Python Lists and Loops

Python Lists and Loops WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show

More information