UNIVERSITY OF WINDSOR Fall 2006 QUIZ # 1. Examiner:Ritu Chaturvedi Dated : Oct 3rd, Student Name: Student Number:

Similar documents
Quiz1 Fall 2007 October 2 nd, UNIVERSITY OF WINDSOR Fall 2007 QUIZ # 1 Solution. Examiner:Ritu Chaturvedi Dated :October 2nd, 2007.

UNIVERSITY OF WINDSOR Winter 2007 QUIZ # 1 Solution. Examiner:Ritu Chaturvedi Dated : Feb 7 th, Student Name: Student Number:

UNIVERSITY OF WINDSOR Fall 2007 QUIZ # 2 Solution. Examiner : Ritu Chaturvedi Dated :November 27th, Student Name: Student Number:

AMCAT Automata Coding Sample Questions And Answers

Full file at C How to Program, 6/e Multiple Choice Test Bank

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

CSE101-lec#12. Designing Structured Programs Introduction to Functions. Created By: Amanpreet Kaur & Sanjeev Kumar SME (CSE) LPU

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Flow Chart. The diagrammatic representation shows a solution to a given problem.

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

C: How to Program. Week /Mar/05

Note: unless otherwise stated, the questions are with reference to the C Programming Language. You may use extra sheets if need be.

.. Cal Poly CPE 101: Fundamentals of Computer Science I Alexander Dekhtyar..

Control Structure: Loop

Lab Exam 1 D [1 mark] Give an example of a sample input which would make the function

Chapter 2 - Introduction to C Programming

Functions. Arash Rafiey. September 26, 2017

CSE 5A Final Fall 2006

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

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information

Compiling and Running a C Program in Unix

H192 Midterm 1 Review. Tom Zajdel

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

The American University in Cairo Department of Computer Science & Engineering CSCI &09 Dr. KHALIL Exam-I Fall 2011

Part 1 (80 points) Multiple Choice Questions (20 questions * 4 points per question = 80 points)

Chapter 3 Structured Program Development

Types. C Types. Floating Point. Derived. fractional part. no fractional part. Boolean Character Integer Real Imaginary Complex

SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, ) SOLUTION

Technical Questions. Q 1) What are the key features in C programming language?

AN OVERVIEW OF C. CSE 130: Introduction to Programming in C Stony Brook University

Chapter 1 & 2 Introduction to C Language

Lecture 2. Examples of Software. Programming and Data Structure. Programming Languages. Operating Systems. Sudeshna Sarkar

Introduction to the C Programming Language

Guide for The C Programming Language Chapter 1. Q1. Explain the structure of a C program Answer: Structure of the C program is shown below:

Programming Fundamentals (CS 302 ) Dr. Ihsan Ullah. Lecturer Department of Computer Science & IT University of Balochistan

Programming and Data Structure

COMP 208 Computers in Engineering

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University

Fundamentals of Programming Session 4

Approximately a Final Exam CPSC 206

Functions. Lab 4. Introduction: A function : is a collection of statements that are grouped together to perform an operation.

Chapter 1 INTRODUCTION

School of Computer Science Introduction to Algorithms and Programming Winter Midterm Examination # 1 Wednesday, February 11, 2015

Introduction to Computer Science Midterm 3 Fall, Points

Copy: IF THE PROGRAM or OUTPUT is Copied, then both will have grade zero.

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

Computational Expression

Course Outline. Introduction to java

Intro to Computer Programming (ICP) Rab Nawaz Jadoon

Introduction to C Programming. Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan

CS Introduction to Programming Midterm Exam #2 - Prof. Reed Fall 2015

Differentiate Between Keywords and Identifiers

Chapter 2: Overview of C. Problem Solving & Program Design in C

These are reserved words of the C language. For example int, float, if, else, for, while etc.

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

Computer Programming. Decision Making (2) Loops

BRANCHING if-else statements

Lecture 16. Daily Puzzle. Functions II they re back and they re not happy. If it is raining at midnight - will we have sunny weather in 72 hours?

C How to Program, 7/e by Pearson Education, Inc. All Rights Reserved.

Introduction to C Final Review Chapters 1-6 & 13

CSc Introduction to Computing

Unit 7. Functions. Need of User Defined Functions

Preview from Notesale.co.uk Page 6 of 52

Lecture 3. More About C

Decision Making -Branching. Class Incharge: S. Sasirekha

CSE123 LECTURE 3-1. Program Design and Control Structures Repetitions (Loops) 1-1

Concepts Review. 2. A program is the implementation of an algorithm in a particular computer language, like C and C++.

Binding and Variables

Università degli Studi di Bologna Facoltà di Ingegneria. Principles, Models, and Applications for Distributed Systems M

Computers in Engineering. Moving From Fortran to C Michael A. Hawker

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

CS111: PROGRAMMING LANGUAGE II

Question 2. [2 points] True False By default, structures are passed-by-reference.

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each.

ARRAYS(II Unit Part II)

Structured Programming. Functions and Structured Programming. Functions. Variables

Unit 1: Introduction to C Language. Saurabh Khatri Lecturer Department of Computer Technology VIT, Pune

15 FUNCTIONS IN C 15.1 INTRODUCTION

Computing Science 114 Solutions to Midterm Examination Tuesday October 19, In Questions 1 20, Circle EXACTLY ONE choice as the best answer

Data Types and Variables in C language

C++ Programming for Non-C Programmers. Supplement

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

Introduction to C programming. By Avani M. Sakhapara Asst Professor, IT Dept, KJSCE

Fundamentals of C Programming

Spring Semester 13, Dr. Punch. Exam #1 (2/14), form 1 A

Lesson 3 Introduction to Programming in C

Computer System and programming in C

Materials covered in this lecture are: A. Completing Ch. 2 Objectives: Example of 6 steps (RCMACT) for solving a problem.

CS Introduction to Programming Midterm Exam #1 - Prof. Reed Spring 03

UNIT III (PART-II) & UNIT IV(PART-I)

Basics of Programming

Lecture 2 Tao Wang 1

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR Stamp / Signature of the Invigilator

CS-211 Fall 2017 Test 1 Version A Oct. 2, Name:

UIC. C Programming Primer. Bharathidasan University

COMPUTER APPLICATION

Overview of C, Part 2. CSE 130: Introduction to Programming in C Stony Brook University

3. Types of Algorithmic and Program Instructions

Transcription:

UNIVERSITY OF WINDSOR 60-106-01 Fall 2006 QUIZ # 1 Examiner:Ritu Chaturvedi Dated : Oct 3rd, 2006. Student Name: Student Number: INSTRUCTIONS (Please Read Carefully) Examination Period is : 1 hour Answer all questions in the bubble sheet provided to you. You must use a pencil to mark the answer. There are 25 multiple choice questions(questions 1-25) and 5 True/False questions(questions 26-30). Select only one answer for each question. Write your name and student number on the examination paper as well as the bubble sheet and submit both the bubble sheet and the examination paper before you leave the exam hall. Total Marks : 60 Total number of pages : 10 There may be more than one possible answer. Choose the best possible answer. Good Luck!!! 1

Multiple choice Questions : (25 x 2 = 50 marks) 1. A main memory with capacity 64 Kilobytes has approximately : a. 64 thousand cells b. 64 million cells c. 64 billion cells d. 64 cells 2. Given the equation y=ax 3 + 7, which of the following are correct C statements for this equation? a. y = a * x * x * x + 7; b. y = a * x * x * (x + 7); c. y = a * (x * x * x) + 7; d. y = (a * x ) * (x * x) + 7; 3. What arithmetic operators are on the same level of precedence as multiplication? a. + b. % c. / d. b and c e. a and b 4. What value gets stored in c after the following instructions are executed? int a,b,c; a = 4; b = 2; c = b * a / b % 2-1; a. 7 b. 7.5 c. -1 d. -2 2

5. The simple program segment for getting the sum of two numbers is. a. scanf( %d %d,num1, Num2); sum = Num1 + Num2; printf( %d,sum); b. scanf( %d%d,&num1,&num2); sum = Num1 + Num2; printf( %d,sum); c. scanf( %d %d,&num1, &Num2); average = (Num1 + Num2)/2; printf( %d,average); d. Read Num1, Num2; Sum = Num1 + Num2; Print Sum; 6. The correct statement which prints out the text Welcome, followed by a newline is : a. printf( Welcome\n ); b. printf(welcome, \n ); c. printf( Welcome\n ); d. printf(welcome\n); 7. The statement which prints out the value of the character variable letter, is a. printf(letter); b. printf( %c,&letter); c. printf( %d,&letter); d. printf( %c,letter); 3

8. Which one of the following expressions does not evaluate to 3? a. 2 + 6 % 5 b. 8-17 / 4 c. 6 * 5 / 10 d. 26-26 / 2-10 e. 8-5 9. Text enclosed in /* */ in a C program. a. gives instructions to the processor b. declares memory requirements c. makes files available d. causes a syntax error e. is a comment ignored by the C compiler 10. If num is a variable of type int and temp is a variable of type float, how could you correctly complete this function call? scanf("%f%d", ); a. num, temp b. &num, &temp c. temp, num d. &temp, &num 4

What data type would you use to represent in the computer for the following items in questions 11 and 12. 11. Number of students registered in 60-140 this semester a. int b. float c. char d. boolean 12. The average marks in quiz1 a. int b. float c. char d. boolean 13. A location in the computer s memory that may contain different values at various times throughout the execution of a program is called a. a. constant b. variable c. keyword d. entity 14. Which of the following statements is a call to function abc? a. call abc; b. abc; c. p = abc(q); d. void abc(void); 5

15. Which of the types listed below can be the data type of the result value returned by a user-defined function? a. int b. double c. char d. all of the above 16. The UNIX command on arc1.uwindsor.ca to compile a C program called a.c is: a. CC a.c b. cc a.c c. pico a.c d. a.out 17. Which of the following variable declarations are invalid? a. float num; b. int q; c. char plywood; d. all of the above 6

18. A diagram of the hierarchical organization of the subproblems of a solution is called. a. stepwise refinement b. divide and conquer c. a top-down approach d. function calls e. a structure chart 19. Keyword is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters. a. int b. zero c. void d. Nothing 20. The statement(in C) that correctly defines an integer called sum is a. sum : integer; b. integer sum; c. int sum; d. sum int; 7

21. What value is assigned to q in the statement q = f(3, 3, 4); if f is defined as follows? int f(int a, int b, int c) { } return (a+b+c); a. 17 b. 10 c. 36 d. 0 22. The prototype for function f (defined in question 21) should be declared as : a. int f(int,int,int) b. int f(int,int,int); c. void f(int,int,int); d. void f(void); 8

Use the program below to answer questions 23,24 and 25. #include <stdio.h> void module1(int, int); void main(void){ int a, b,c; a=7; b=8; c=2; module1 (a,b); printf( %d %d \n,a, b); } //end of main void module1 (int a, int b){ a = a - 2; b = b + 2; } 23. What values of a gets printed when the above program is run? a. 0 b. 2 c. 8 d. 7 24. What values of b gets printed when the above program is run? a. 0 b. 2 c. 8 d. 7 9

25. Which statement in the above program is a call to function module1? a. module1(a,b); b. void module1(int a, int b){ c. void module1(int, int); d. Any of the above True or False (5 x 2 = 10 marks) a. True b. False 26. Formal parameters are specified in the function header. True 27. Actual parameters are specified in the function header. False 28. Statements in a high-level language are converted to statements in machine language by a loader. False 29. This assignment statement stores the sum of b and c in a: b + c = a; False 30. Because the following statement is a valid call to function wow, wow must be a void function. wow(x, y); True 10