Algorithms 4. Odd or even Algorithm 5. Greatest among three numbers Algorithm 6. Simple Calculator Algorithm

Size: px
Start display at page:

Download "Algorithms 4. Odd or even Algorithm 5. Greatest among three numbers Algorithm 6. Simple Calculator Algorithm"

Transcription

1 s 4. Odd or even Step 3 : If number divisible by 2 then Print "Number is Even" Step 3.1 : else Print "Number is Odd" Step 4 : Stop 5. Greatest among three numbers Step 2 : Read values of a, b and c Step 3 : If a > b and a > c then Print "A is the biggest" Step 3.1 : else if b>c then Print "B is the biggest " Step 3.2 : else Print "C is the biggest" Step 4 : Stop 6. Simple Calculator Step 2 : Read operands a and b Step 3 : Display operation menu Step 4 : Read option Step 5 : If option = 1 then Calculate c = a + b Step 5.1 : else if option = 2 then Calculate c = a b Step 5.2 : else if option = 3 then Calculate c = a * b Step 5.3 : else if option = 4 then Calculate c = a / b Step 5.4 : else if option = 5 then Calculate c = a % b Step 5.5 : else Print "Invalid option" Step 6 : Print c Step 7 : Stop

2 7. Summation of N numbers Step 2 : Read n Step 3 : Initialize 0 to sum and 1 to i Step 4 : Add i to sum Step 5 : Increment i by 1 Step 6: Repeat steps 4 6 until i>n Step 7 : Print sum 8. Simple Interest and Compound Interest Step 2 : Read the values principal, rate and years Step 3 : Compute simple interest using the formulae: (principal rate years) / 100 Step 4 : Print simple interest Step 5 : Compute compound interest using the formulae: principal*pow(1+rate/100,years) principal Step 6 : Print compound interest Step 7: stop 9. Quotient and Remainder of two numbers Step 2 : Read the values of two numbers a and b Step 3 : Compute quotient by divide a by b Step 4: compute remainder by taking a mod b Step 5: display quotient and remainder Step 6: stop 10. Area and Circumference of a Circle Step 2 : Define constant pi = 3.14 Step 3 : Read the value of radius Step 4 : Calculate area using formulae: pi radius2 Step 5 : Calculate circumference using formulae: 2 pi radius Step 6 : Print area and circumference Step 7 : Stop 11. Fibonacci Series of terms as n

3 Step 3 : Initialize 0 to f1, 1 to f2 and 2 to i Step 4 : Print initial fibonacci terms f1, f2 Step 5 : Generate next term using the formula f3 = f1 + f2 Step 6 : Print f3 Step 7 : Increment i by 1 Step 8 : Assign f2 to f1 Step 9 : Assign f3 to f2 Step 10 : Repeat steps 5 9 until i<n Step 11 : Stop 12. Prime Number or Not Step 2 : Read the value of n Step 3 : Initialize i to 2 Step 4 : If n is divisible by i then Print Not Prime and Stop Step 5 : Increment i by 1 Step 6 : Repeat steps 4 and 5 until i>n/2 Step 7 : Print "Prime" 13. Factorial of a Number Step 3 : Initialize 1 to fact and number to i Step 4 : fact = fact * i Step 5 : Decrement i by 1 Step 6: Repeat steps 4 6 until i> 0 Step 7 : Print fact 14. Reverse the digits of a number Step 3 : Initialize 0 to reverse Step 5 : Compute reverse = reverse10 + lastdigit Step 8 : Print reverse 15. Sum of digits

4 Step 3 : Initialize sum=0 Step 5 : Compute sum=sum+ reverse Step 8 : Print the sum of digits 16. GCD of Numbers Step1: start Step 2: Read the values m and n Step 3: Check whether m is not equal to n. If it is not equal, then do the next step. Otherwise Go to step 7 Step 4: If m is greater than n then computer m=m-n Step 5: else if n is greater than n, then compute n=n-m Step 6: repeat step 3 Step 7: display the result m as the GCD of two number Step 8: stop 17. Palindrome or Not Step 3 : Initialize 0 to reverse Step 5 : Compute reverse = reverse10 + lastdigit Step 8 : If the given number is equal to the reverse then print the number is a palindrome. Otherwise, it is not a palindrome. 18. Roots of a Quadratic Equation Step 1: Read a,b,c Step 2: calculate the roots using the formula Root1 = -b +( d / 2*a) Root2 = -b ( d / 2*a) Where d=b 2-4ac Step 3: Display the roots Step 4: stop

5 19. Armstrong Number Step 3 : Initialize 0 to sum and number to num Step 5 : Cube the lastdigit and add it to sum Step 8 : If sum = number then Print Armstrong number Step 8.1 : else Print Not an Armstrong number C PROGRAMMING 20. Sort n numbers Step 2 : Read the value n Step 3: Read n numbers using array Step 4: Set i=0 to n-1 increment by 1 Step 5: set j=i+1 to n increment by 1 Step 6: If the value of i is greater than j then swap a[i] and a[j]. Step 7: Repeat step 5 & 6 Step 8: Repeat steps 4 to 7 Step 9: Display the result Step 10: stop 21. Minimum and maximum of a set of numbers Step 2 : Read the value n Step 3: Read n numbers using array Step 4: Assign min -> a[0] and max -> a[0] Step 5: Set i=1 to n increment by 1 Step 6: If min is greater than a[i] then assign min->a[i] and If max is smaller than a[i] then assign max=a[i]. Step 7: Repeat steps 5 & 6 Step 8: Display min and max Step 9: stop Step 2 : Read n 22. Sum of n numbers

6 Step 3 : Initialize 0 to sum and 1 to i Step 4 : Add i to sum Step 5 : Increment i by 1 Step 6: Repeat steps 4 6 until i>n Step 7 : Print sum 23. Matrix addition Step 2 : Read the value of the matrix A[2 2] Step 3 : Read the value of the matrix B[ 2 2] Step 4: set i-> 1 to 2 increment by 1 Step 5: set j=1 to 2 increment by 1 Step 6: Add the two matrix by S[i][j]=A[i][j]+B[i][j] Step 7: Repeat steps 4 to 6 Step 8: Display the resultant matrix S Step 9: stop 24. Roots of a quadratic equation Step 1: Read a,b,c Step 2: calculate the roots using the formula Root1 = -b +( d / 2*a) Root2 = -b ( d / 2*a) Where d=b 2-4ac Step 3: Display the roots Step 4: stop 25. Linear search Step 2: Read the value n Step 3: Read n elements using array Step 4: Read the search item search Step 5: Set i-> 1 to n increment by 1 Step 6: If search element is matched with the array element then display element is found and exit from the program Step 7: Otherwise, Repeat step 5 & 6 Step 8: If the search item is not matched with any array element then Display element is not found Step 9: Stop Step 1: start 26. Binary search

7 Step 2: Get N elements and store the elements in the array K in ascending order. Step 3:Get the element to be searched X. Step 4:Initialize LOW=1,HIGH=N; Step 5:Until LOW<= HIGH check whether X <K[MIDDLE] Step 6:if so HIGH=MIDDLE-1, Otherwise check whether X > K[MIDDLE]. Step 6:if so LOW=MIDDLE+1,Otherwise Display UNSUCCESSFUL SEARCH Step 7: Stop 27. Call by value : Step 2: Read x & y Step 3: Call the function swap and pass the value of x & y as arguments Step 4: Execute the function swap and interchange the value of x and y Step 5: Display the result Step 6: Stop 28. Call by Reference : Step 2: Read x & y Step 3: Call the function swap and pass the address of x & y as arguments Step 4: Execute the function swap and interchange the value of x and y Step 5: Display the result Step 6: Stop 29. Structures : Step 2: Declare the structure distance with feet and inch as arguments Step 3: Create the objects d1,d2 and sum for the structures Step 4: Read the input for the object d1 & d2 Step 5: Add the values of the objects d1 and d2 and store it in sum Step 6: Display the result of the object sum Step 7: Stop 30. File I/O : Step 2: Create a text file out.txt Step 3: Create a file pointer fp Step 4: Open a file out.txt in read mode Step 5: Get a character one by one from the input file and display it until the end of file is reached. Step 6: Stop

PROGRAMMING IN C AND C++:

PROGRAMMING IN C AND C++: PROGRAMMING IN C AND C++: Week 1 1. Introductions 2. Using Dos commands, make a directory: C:\users\YearOfJoining\Sectionx\USERNAME\CS101 3. Getting started with Visual C++. 4. Write a program to print

More information

Examples for Algorithm,Pseduocode,Flowchart

Examples for Algorithm,Pseduocode,Flowchart 1 Examples for,pseduocode,flowchart Example: Finding the area of a circle Step2: Read the value of r Step3: Calculate area = 3.14*r*r Step4: Print area Step5: Stop Set area READ the r COMPUTE area=3.14*r*r

More information

Lab Manual. Program Design and File Structures (P): IT-219

Lab Manual. Program Design and File Structures (P): IT-219 Lab Manual Program Design and File Structures (P): IT-219 Lab Instructions Several practicals / programs? Whether an experiment contains one or several practicals /programs One practical / program Lab

More information

INDEX. Sl. No. Programs Page No. Procedure 2. 1 To check whether person is eligible for vote or not. 2 To find the given number is even or odd 6-8

INDEX. Sl. No. Programs Page No. Procedure 2. 1 To check whether person is eligible for vote or not. 2 To find the given number is even or odd 6-8 INDEX Sl. No. Programs Page No. Procedure 2 1 To check whether person is eligible for vote or not 3-5 2 To find the given number is even or odd 6-8 3 To find the given year is leap year or not 9-11 4 To

More information

DR. A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY LUCKNOW. Evaluation Scheme & Syllabus. For. B.Tech. First Year (Programming for Problem Solving)

DR. A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY LUCKNOW. Evaluation Scheme & Syllabus. For. B.Tech. First Year (Programming for Problem Solving) DR. A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY LUCKNOW Evaluation Scheme & Syllabus For B.Tech. First Year (Programming for Problem Solving) On Choice Based Credit System (Effective from the Session: 2018-19)

More information

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR 603 203 FIRST SEMESTER B.E / B.Tech., (Common to all Branches) QUESTION BANK - GE 6151 COMPUTER PROGRAMMING UNIT I - INTRODUCTION Generation and

More information

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE 1. Write a C program to perform addition, subtraction, multiplication and division of two numbers. # include # include int a, b,sum,

More information

Downloaded from

Downloaded from CLASS 11 COMPUTER SCIENCE (83) PRACTICAL LIST 1. Write a C++ Program to find area & circumference of circle. 2. Write a C++ Program to display ASCII character & vice versa. 3. Write a C++ Program to find

More information

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS All programs need to be submitted on 7th Oct 206 by writing in hand written format in A4 sheet. Flowcharts, algorithms, source codes and outputs

More information

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 Code: DC-05 Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 NOTE: There are 11 Questions in all. Question 1 is compulsory and carries 16 marks. Answer to Q. 1. must be written in the space

More information

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING SIDDARTHA INSTITUTE OF SCIENCE AND TECHNOLOGY:: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : PROGRAMMING FOR PROBLEM SOLVING (18CS0501) Course & Branch

More information

Subject: Computer Science

Subject: Computer Science Subject: Computer Science Topic: Data Types, Variables & Operators 1 Write a program to print HELLO WORLD on screen. 2 Write a program to display output using a single cout statement. 3 Write a program

More information

Math 083 Final Exam Practice

Math 083 Final Exam Practice Math 083 Final Exam Practice Name: 1. Simplify the expression. Remember, negative exponents give reciprocals.. Combine the expressions. 3. Write the expression in simplified form. (Assume the variables

More information

Module 2: Classical Algorithm Design Techniques

Module 2: Classical Algorithm Design Techniques Module 2: Classical Algorithm Design Techniques Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu Module

More information

/* Area and circumference of a circle */ /*celsius to fahrenheit*/

/* Area and circumference of a circle */ /*celsius to fahrenheit*/ /* Area and circumference of a circle */ #include #include #define pi 3.14 int radius; float area, circum; printf("\nenter radius of the circle : "); scanf("%d",&radius); area = pi

More information

Loops / Repetition Statements

Loops / Repetition Statements Loops / Repetition Statements Repetition statements allow us to execute a statement multiple times Often they are referred to as loops C has three kinds of repetition statements: the while loop the for

More information

Questions Bank. 14) State any four advantages of using flow-chart

Questions Bank. 14) State any four advantages of using flow-chart Questions Bank Sub:PIC(22228) Course Code:-EJ-2I ----------------------------------------------------------------------------------------------- Chapter:-1 (Overview of C Programming)(10 Marks) 1) State

More information

C- PROGRAMMING (3:0:0) Sub code : CS1C01/CS2C01 CIE : 50%Marks Hrs/week : 03 SEE : 50%Marks SEE Hrs : 03 Hours Max. Marks: 100 Course Outcomes:

C- PROGRAMMING (3:0:0) Sub code : CS1C01/CS2C01 CIE : 50%Marks Hrs/week : 03 SEE : 50%Marks SEE Hrs : 03 Hours Max. Marks: 100 Course Outcomes: C- PROGRAMMING (3:0:0) Sub code : CS1C01/CS2C01 CIE : 50%Marks Hrs/week : 03 SEE : 50%Marks SEE Hrs : 03 Hours Max. Marks: 100 Course Outcomes: On successful completion of the course, the students will

More information

Suggestive List of C++ Programs

Suggestive List of C++ Programs Suggestive List of C++ Programs 1. Write a C++ program to display Hello World! on the output screen. 2. Write a program to display Multiplication Table of a number inputted by the user. 3. Write a program

More information

(i) Describe in detail about the classification of computers with their features and limitations(10)

(i) Describe in detail about the classification of computers with their features and limitations(10) UNIT I - INTRODUCTION Generation and Classification of Computers- Basic Organization of a Computer Number System Binary Decimal Conversion Problems. Need for logical analysis and thinking Algorithm Pseudo

More information

Assignment: 1. (Unit-1 Flowchart and Algorithm)

Assignment: 1. (Unit-1 Flowchart and Algorithm) Assignment: 1 (Unit-1 Flowchart and Algorithm) 1. Explain: Flowchart with its symbols. 2. Explain: Types of flowchart with example. 3. Explain: Algorithm with example. 4. Draw a flowchart to find the area

More information

PROBLEM SOLVING TECHNIQUES SECTION - A. 1. Answer any ten of the following

PROBLEM SOLVING TECHNIQUES SECTION - A. 1. Answer any ten of the following PROBLEM SOLVING TECHNIQUES SECTION - A 1. Answer any ten of the following a. Define an algorithm. An algorithm is a finite set of instructions that if followed, accomplishes a particular task. b. Define

More information

***********PYTHON PROGRAMS FOR CLASS XI ******************** """ Program to Calculate Simple Interest """ p = eval(input("enter Principle?

***********PYTHON PROGRAMS FOR CLASS XI ********************  Program to Calculate Simple Interest  p = eval(input(enter Principle? ***********PYTHON PROGRAMS FOR CLASS XI ******************** 1. """ Program to Calculate Simple Interest """ p = eval(input("enter Principle? ")) r = eval(input("enter Rate? ")) t = eval(input("enter Time?

More information

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104 Semester: II Subject Name: Computer Programming Subject Code: 09CE1104 Objective: This Course will help to develop programming skills in the students, using a structured programming language `C'. Students

More information

1. How many white tiles will be in Design 5 of the pattern? Explain your reasoning.

1. How many white tiles will be in Design 5 of the pattern? Explain your reasoning. Algebra 2 Semester 1 Review Answer the question for each pattern. 1. How many white tiles will be in Design 5 of the pattern Explain your reasoning. 2. What is another way to represent the expression 3.

More information

COMPUTER PROGRAMMING LAB

COMPUTER PROGRAMMING LAB COURSE OUTCOMES SEMESTER I Student will be able to: COMPUTER PROGRAMMING LAB 1. Explain basic commands in Linux. 2. Develop programs in C language. 3. Design programs for various problems in C language.

More information

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

VARIABLE, OPERATOR AND EXPRESSION [SET 1] VARIABLE, OPERATOR AND EXPRESSION Question 1 Write a program to print HELLO WORLD on screen. Write a program to display the following output using a single cout statement. Subject Marks Mathematics 90

More information

Chapter 3 Problem Solving and the Computer

Chapter 3 Problem Solving and the Computer Chapter 3 Problem Solving and the Computer An algorithm is a step-by-step operations that the CPU must execute in order to solve a problem, or to perform that task. A program is the specification of an

More information

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI 2017-2018 Worksheet No. 1 Topic : Getting Started With C++ 1. Write a program to generate the following output: Year Profit% 2011 18 2012 27 2013 32

More information

Alignment to the Texas Essential Knowledge and Skills Standards

Alignment to the Texas Essential Knowledge and Skills Standards Alignment to the Texas Essential Knowledge and Skills Standards Contents Kindergarten... 2 Level 1... 4 Level 2... 6 Level 3... 8 Level 4... 10 Level 5... 13 Level 6... 16 Level 7... 19 Level 8... 22 High

More information

Sardar Patel University S Y BSc. Computer Science CS-201 Introduction to Programming Language Effective from July-2002

Sardar Patel University S Y BSc. Computer Science CS-201 Introduction to Programming Language Effective from July-2002 Sardar Patel University S Y BSc. Computer Science CS-201 Introduction to Programming Language Effective from July-2002 2 Practicals per week External marks :80 Internal Marks : 40 Total Marks :120 University

More information

Computer Programming C++ (wg) CCOs

Computer Programming C++ (wg) CCOs Computer Programming C++ (wg) CCOs I. The student will analyze the different systems, and languages of the computer. (SM 1.4, 3.1, 3.4, 3.6) II. The student will write, compile, link and run a simple C++

More information

1. Basics 1. Write a program to add any two-given integer. Algorithm Code 2. Write a program to calculate the volume of a given sphere Formula Code

1. Basics 1. Write a program to add any two-given integer. Algorithm Code  2. Write a program to calculate the volume of a given sphere Formula Code 1. Basics 1. Write a program to add any two-given integer. Algorithm - 1. Start 2. Prompt user for two integer values 3. Accept the two values a & b 4. Calculate c = a + b 5. Display c 6. Stop int a, b,

More information

AC64/AT64 DESIGN & ANALYSIS OF ALGORITHMS DEC 2014

AC64/AT64 DESIGN & ANALYSIS OF ALGORITHMS DEC 2014 AC64/AT64 DESIGN & ANALYSIS OF ALGORITHMS DEC 214 Q.2 a. Design an algorithm for computing gcd (m,n) using Euclid s algorithm. Apply the algorithm to find gcd (31415, 14142). ALGORITHM Euclid(m, n) //Computes

More information

CP I LAB MANUAL. Expt No 2 To Check Whether A Year Is A Leap Year Using if-else-if.

CP I LAB MANUAL. Expt No 2 To Check Whether A Year Is A Leap Year Using if-else-if. CP I LAB MANUAL Expt No: 1 To find roots of quadratic equation if-else statement Sample Output Enter the coefficients 1-4 4 The roots are 2 & 2 A 1) start 2) declare the required variables 3) read the

More information

I Year MCA I Semester L T P To C FOUNDATIONS OF INFORMATION TECHNOLOGY

I Year MCA I Semester L T P To C FOUNDATIONS OF INFORMATION TECHNOLOGY I Year MCA I Semester L T P To C 3 1-4 4 MC101 FOUNDATIONS OF INFORMATION TECHNOLOGY Objectives of the Course: It offers students an overall idea of computer science and information technology to the student.

More information

OOP ASSIGNMENT -1 GROUP -1. Dhananjeyan.J. Balakumaran.M. Sivaram. S.E. Tamilarasan.T GROUP-2. Hariharan.R. Visnu.S. Daniel Napolen.

OOP ASSIGNMENT -1 GROUP -1. Dhananjeyan.J. Balakumaran.M. Sivaram. S.E. Tamilarasan.T GROUP-2. Hariharan.R. Visnu.S. Daniel Napolen. GROUP -1 Dhananjeyan.J Balakumaran.M Sivaram. S.E Tamilarasan.T 1. Write a simple program to read 10 double precision floating point numbers and add all the 10 numbers using c++. 2. Write a simple program

More information

PROGRAMS. EXCELLENT ACADEMY OF ENGINEERING. Telephone: / NORMAL PROGRAM

PROGRAMS. EXCELLENT ACADEMY OF ENGINEERING. Telephone: / NORMAL PROGRAM PROGRAMS NORMAL PROGRAM 1. Wap to display months in words where month in number is input. 2. Wap to print Fibonacci series till n elements. 3. Wap to reverse 4 digit numbers. 4. Wap to accept a number

More information

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C Sample Test Paper-I Marks : 25 Time:1 Hrs. Q1. Attempt any THREE 09 Marks a) State four relational operators with meaning. b) State the use of break statement. c) What is constant? Give any two examples.

More information

Practical List of. MCA IV SEM Session -2010

Practical List of. MCA IV SEM Session -2010 1. WAP to create own exception. Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of MCA IV SEM Session -2010 MCA-401 - Internet and Java Programming

More information

Assertions & Verification & Example Loop Invariants Example Exam Questions

Assertions & Verification & Example Loop Invariants Example Exam Questions 2014 November 27 1. Assertions & Verification & Example Loop Invariants Example Exam Questions 2. A B C Give a general template for refining an operation into a sequence and state what questions a designer

More information

LOOPS. 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ).

LOOPS. 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ). LOOPS 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ). 2-Give the result of the following program: #include

More information

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9 Fundamental of C Programming Unit I: Q1. What will be the value of the following expression? (2017) A + 9 Q2. Write down the C statement to calculate percentage where three subjects English, hindi, maths

More information

Assertions & Verification Example Exam Questions

Assertions & Verification Example Exam Questions 2009 November 23 Assertions & Verification Example Exam Questions 1. 2. A B C Give a general template for refining an operation into a sequence and state what questions a designer must answer to verify

More information

1. Find f(1), f(2), f(3), and f(4) if f(n) is defined recursively by f(0) = 1 and for n = 0, 1, 2,

1. Find f(1), f(2), f(3), and f(4) if f(n) is defined recursively by f(0) = 1 and for n = 0, 1, 2, Exercises Exercises 1. Find f(1), f(2), f(3), and f(4) if f(n) is defined recursively by f(0) = 1 and for n = 0, 1, 2, a) f(n + 1) = f(n) + 2. b) f(n + 1) = 3f(n). c) f(n + 1) = 2f(n). d) f(n + 1) = f(n)2

More information

CS1100 Introduction to Programming

CS1100 Introduction to Programming Decisions with Variables CS1100 Introduction to Programming Selection Statements Madhu Mutyam Department of Computer Science and Engineering Indian Institute of Technology Madras Course Material SD, SB,

More information

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

These are reserved words of the C language. For example int, float, if, else, for, while etc. Tokens in C Keywords These are reserved words of the C language. For example int, float, if, else, for, while etc. Identifiers An Identifier is a sequence of letters and digits, but must start with a letter.

More information

MODULE 2: Branching and Looping

MODULE 2: Branching and Looping MODULE 2: Branching and Looping I. Statements in C are of following types: 1. Simple statements: Statements that ends with semicolon 2. Compound statements: are also called as block. Statements written

More information

Introduction to Computer Science Midterm 3 Fall, Points

Introduction to Computer Science Midterm 3 Fall, Points Introduction to Computer Science Fall, 2001 100 Points Notes 1. Tear off this sheet and use it to keep your answers covered at all times. 2. Turn the exam over and write your name next to the staple. Do

More information

Names and Functions. Chapter 2

Names and Functions. Chapter 2 Chapter 2 Names and Functions So far we have built only tiny toy programs. To build bigger ones, we need to be able to name things so as to refer to them later. We also need to write expressions whose

More information

Outline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail.

Outline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail. OOP in Java 1 Outline 1. Getting started, primitive data types and control structures 2. Classes and objects 3. Extending classes 4. Using some standard packages 5. OOP revisited Parts 1 to 3 introduce

More information

UEE1302(1066) F12: Introduction to Computers and Programming Function (II) - Parameter

UEE1302(1066) F12: Introduction to Computers and Programming Function (II) - Parameter UEE1302(1066) F12: Introduction to Computers and Programming Function (II) - Parameter What you will learn from Lab 7 In this laboratory, you will understand how to use typical function prototype with

More information

Chapter 1: Number and Operations

Chapter 1: Number and Operations Chapter 1: Number and Operations 1.1 Order of operations When simplifying algebraic expressions we use the following order: 1. Perform operations within a parenthesis. 2. Evaluate exponents. 3. Multiply

More information

RECURSION (CH 5) A pattern for solving algorithm design problems

RECURSION (CH 5) A pattern for solving algorithm design problems RECURSION (CH 5) A pattern for solving algorithm design problems Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich, R. Tamassia, and M. H.,

More information

Counting Loop: DO-END DO. DO var = initial-value, final-value, step-size

Counting Loop: DO-END DO. DO var = initial-value, final-value, step-size Counting Loop: - Syntax Form 1 var = initial-value, final-value, step-size statements Form 2 If step-size is 1, use var = initial-value, final-value statements var is a variable of type INTEGER. initial-value,

More information

3 The L oop Control Structure

3 The L oop Control Structure 3 The L oop Control Structure Loops The while Loop Tips and Traps More Operators The for Loop Nesting of Loops Multiple Initialisations in the for Loop The Odd Loop The break Statement The continue Statement

More information

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal MA 511: Computer Programming Lecture 3: http://www.iitg.ernet.in/psm/indexing_ma511/y10/index.html Partha Sarathi Mandal psm@iitg.ernet.ac.in Dept. of Mathematics, IIT Guwahati Semester 1, 2010-11 Last

More information

COP 4516: Math for Programming Contest Notes

COP 4516: Math for Programming Contest Notes COP 4516: Math for Programming Contest Notes Euclid's Algorithm Euclid's Algorithm is the efficient way to determine the greatest common divisor between two integers. Given two positive integers a and

More information

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK

CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK Page 1 UNIT I INTRODUCTION 2 marks 1. Why is the need of studying algorithms? From a practical standpoint, a standard set of algorithms from different

More information

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013 Information Technology, UTU 203 030000 Fundamentals of Programming Problems to be solved in laboratory Note: Journal should contain followings for all problems given below:. Problem Statement 2. Algorithm

More information

WYSE Academic Challenge Computer Science Test (Regional) 2015 Solution Set

WYSE Academic Challenge Computer Science Test (Regional) 2015 Solution Set WYSE Academic Challenge Computer Science Test (Regional) 2015 Solution Set 1. Correct Answer: B Encapsulation refers to hiding the data behind get and set methods to insure that those using the class cannot

More information

The Hyderabad Public School, Begumpet, Hyderabad, A.P

The Hyderabad Public School, Begumpet, Hyderabad, A.P The Hyderabad Public School, Begumpet, Hyderabad, A.P. 500 016 2012-13 Department of Computer Science Class 8 Worksheet 3 1) How many times will the following statement execute? ( ) int a=5; while(a>6)

More information

Programming Questions and Solutions in Java (15CS561)

Programming Questions and Solutions in Java (15CS561) This document can be downloaded from www.chetanahegde.in with most recent updates. 1 Programming Questions and Solutions in Java (15CS561) 1. Write a program to find area of circle. class Circle int r=3;

More information

Florida Math 0018 Correlation of the ALEKS course Florida Math 0018 to the Florida Mathematics Competencies - Lower

Florida Math 0018 Correlation of the ALEKS course Florida Math 0018 to the Florida Mathematics Competencies - Lower Florida Math 0018 Correlation of the ALEKS course Florida Math 0018 to the Florida Mathematics Competencies - Lower Whole Numbers MDECL1: Perform operations on whole numbers (with applications, including

More information

Haskell through HUGS THE BASICS

Haskell through HUGS THE BASICS Haskell through HUGS THE BASICS FP for DB Basic HUGS 1 Algorithmic Imperative Languages variables assignment if condition then action1 else action2 loop block while condition do action repeat action until

More information

Class 2: Variables and Memory. Laura Marik Spring 2012 C++ Course Notes (Provided by Jason Minski)

Class 2: Variables and Memory. Laura Marik Spring 2012 C++ Course Notes (Provided by Jason Minski) Class 2: Variables and Memory Variables A variable is a value that is stored in memory It can be numeric or a character C++ needs to be told what type it is before it can store it in memory It also needs

More information

Precalculus Notes Unit 1 Day 1

Precalculus Notes Unit 1 Day 1 Precalculus Notes Unit Day Rules For Domain: When the domain is not specified, it consists of (all real numbers) for which the corresponding values in the range are also real numbers.. If is in the numerator

More information

Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of. MCA III SEM Session -2010

Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of. MCA III SEM Session -2010 Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of MCA III SEM Session -2010 MCA-301 - Object Oriented Programming in C++ 1. WAP to generate Fibonacci

More information

TABLE 2: Mathematics College Readiness Standards for Score Range 13 15

TABLE 2: Mathematics College Readiness Standards for Score Range 13 15 TABLE 2: Mathematics College Readiness Standards for Score Range 13 15 Perform one-operation computation with whole numbers and decimals Solve problems in one or two steps using whole numbers Perform common

More information

Week 0. Net Salary =Earnings- deductions; Read the employee number, Basic Print employee Number, Earnings,Deductions and Net salary.

Week 0. Net Salary =Earnings- deductions; Read the employee number, Basic Print employee Number, Earnings,Deductions and Net salary. Week 0. 1. Write a C program that evaluate the following expressions. Assume suitable values for various variables and print the left hand side variable. a) D=ut+1/2 ut 2 b) B=a*e kt c) P=RT/v d) Val=ax

More information

Question Bank (SPA SEM II)

Question Bank (SPA SEM II) Question Bank (SPA SEM II) 1. Storage classes in C (Refer notes Page No 52) 2. Difference between function declaration and function definition (This question is solved in the note book). But solution is

More information

4751 (C1) Introduction to Advanced Mathematics

4751 (C1) Introduction to Advanced Mathematics 475 Mark Scheme 475 (C) Introduction to Advanced Mathematics [ a = ]c b www o.e. for each of complete correct steps, ft from previous error if equivalent difficulty condone = used for first two Ms 5x

More information

RtI 7. Curriculum (219 topics additional topics)

RtI 7. Curriculum (219 topics additional topics) RtI 7 This course covers the topics shown below. Students navigate learning paths based on their level of readiness. Institutional users may customize the scope and sequence to meet curricular needs. Curriculum

More information

11.3 Function Prototypes

11.3 Function Prototypes 11.3 Function Prototypes A Function Prototype contains the function s return type, name and parameter list Writing the function prototype is declaring the function. float square (float x); In a function

More information

Iosif Ignat, Marius Joldoș Laboratory Guide 4. Statements. STATEMENTS in C

Iosif Ignat, Marius Joldoș Laboratory Guide 4. Statements. STATEMENTS in C STATEMENTS in C 1. Overview The learning objective of this lab is: To understand and proper use statements of C/C++ language, both the simple and structured ones: the expression statement, the empty statement,

More information

College Readiness (597 topics) Course Name: College Prep Math Spring 2014 Course Code: ARTD4-3N6XJ

College Readiness (597 topics) Course Name: College Prep Math Spring 2014 Course Code: ARTD4-3N6XJ Course Name: College Prep Math Spring 2014 Course Code: ARTD4-3N6XJ ALEKS Course: Math for College Readiness Instructor: Ms. Dalton Course Dates: Begin: 01/19/2015 End: 06/18/2015 Course Content: 606 Topics

More information

CS111: PROGRAMMING LANGUAGE II

CS111: PROGRAMMING LANGUAGE II 1 CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 1: Introduction Lecture Contents 2 Course info Why programming?? Why Java?? Write once, run anywhere!! Java basics Input/output Variables

More information

Basic and Intermediate Math Vocabulary Spring 2017 Semester

Basic and Intermediate Math Vocabulary Spring 2017 Semester Digit A symbol for a number (1-9) Whole Number A number without fractions or decimals. Place Value The value of a digit that depends on the position in the number. Even number A natural number that is

More information

Programming & Data Structure Laboratory. Day 2, July 24, 2014

Programming & Data Structure Laboratory. Day 2, July 24, 2014 Programming & Data Structure Laboratory Day 2, July 24, 2014 Loops Pre and post test loops for while do-while switch-case Pre-test loop and post-test loop Condition checking True Loop Body False Loop Body

More information

UNIT 3: ANALYSIS OF SIMPLE ALGORITHMS

UNIT 3: ANALYSIS OF SIMPLE ALGORITHMS UNIT 3: ANALYSIS OF SIMPLE ALGORITHMS Analysis of simple Algorithms Structure Page Nos. 3.0 Introduction 85 3.1 Objective 85 3.2 Euclid Algorithm for GCD 86 3.3 Horner s Rule for Polynomial Evaluation

More information

C Program. Output. Hi everyone. #include <stdio.h> main () { printf ( Hi everyone\n ); }

C Program. Output. Hi everyone. #include <stdio.h> main () { printf ( Hi everyone\n ); } C Program Output #include main () { printf ( Hi everyone\n ); Hi everyone #include main () { printf ( Hi everyone\n ); #include and main are Keywords (or Reserved Words) Reserved Words

More information

Computer Programming CS F111

Computer Programming CS F111 Computer Programming CS F111 BITS Pilani Dubai Campus NAND KUMAR Basics of C Programming BITS Pilani Dubai Campus Write a program that 1. Asks 5 marks from the user, find the average of the marks and print

More information

COMP171 Data Structures and Algorithms Fall 2006 Midterm Examination

COMP171 Data Structures and Algorithms Fall 2006 Midterm Examination COMP171 Data Structures and Algorithms Fall 2006 Midterm Examination L1: Dr Qiang Yang L2: Dr Lei Chen Date: 6 Nov 2006 Time: 6-8p.m. Venue: LTA November 7, 2006 Question Marks 1 /12 2 /8 3 /25 4 /7 5

More information

APS Sixth Grade Math District Benchmark Assessment NM Math Standards Alignment

APS Sixth Grade Math District Benchmark Assessment NM Math Standards Alignment SIXTH GRADE NM STANDARDS Strand: NUMBER AND OPERATIONS Standard: Students will understand numerical concepts and mathematical operations. 5-8 Benchmark N.: Understand numbers, ways of representing numbers,

More information

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

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each. I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK 70. a) What is the difference between Hardware and Software? Give one example for each. b) Give two differences between primary and secondary memory.

More information

Iosif Ignat, Marius Joldoș Laboratory Guide 5. Functions. FUNCTIONS in C

Iosif Ignat, Marius Joldoș Laboratory Guide 5. Functions. FUNCTIONS in C FUNCTIONS in C 1. Overview The learning objective of this lab session is to: Understand the structure of a C function Understand function calls both using arguments passed by value and by reference Understand

More information

Functions. Arash Rafiey. September 26, 2017

Functions. Arash Rafiey. September 26, 2017 September 26, 2017 are the basic building blocks of a C program. are the basic building blocks of a C program. A function can be defined as a set of instructions to perform a specific task. are the basic

More information

Mathematics. Jaehyun Park. CS 97SI Stanford University. June 29, 2015

Mathematics. Jaehyun Park. CS 97SI Stanford University. June 29, 2015 Mathematics Jaehyun Park CS 97SI Stanford University June 29, 2015 Outline Algebra Number Theory Combinatorics Geometry Algebra 2 Sum of Powers n k=1 k 3 k 2 = 1 n(n + 1)(2n + 1) 6 = ( k ) 2 = ( 1 2 n(n

More information

An introduction to Scheme

An introduction to Scheme An introduction to Scheme Introduction A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize

More information

Computer System and programming in C

Computer System and programming in C 1 Basic Data Types Integral Types Integers are stored in various sizes. They can be signed or unsigned. Example Suppose an integer is represented by a byte (8 bits). Leftmost bit is sign bit. If the sign

More information

1.1 calculator viewing window find roots in your calculator 1.2 functions find domain and range (from a graph) may need to review interval notation

1.1 calculator viewing window find roots in your calculator 1.2 functions find domain and range (from a graph) may need to review interval notation 1.1 calculator viewing window find roots in your calculator 1.2 functions find domain and range (from a graph) may need to review interval notation functions vertical line test function notation evaluate

More information

Course Outline. Introduction to java

Course Outline. Introduction to java Course Outline 1. Introduction to OO programming 2. Language Basics Syntax and Semantics 3. Algorithms, stepwise refinements. 4. Quiz/Assignment ( 5. Repetitions (for loops) 6. Writing simple classes 7.

More information

KLiC C Programming. (KLiC Certificate in C Programming)

KLiC C Programming. (KLiC Certificate in C Programming) KLiC C Programming (KLiC Certificate in C Programming) Turbo C Skills: The C Character Set, Constants, Variables and Keywords, Types of C Constants, Types of C Variables, C Keywords, Receiving Input, Integer

More information

Lecture 5: Matrices. Dheeraj Kumar Singh 07CS1004 Teacher: Prof. Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur

Lecture 5: Matrices. Dheeraj Kumar Singh 07CS1004 Teacher: Prof. Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur Lecture 5: Matrices Dheeraj Kumar Singh 07CS1004 Teacher: Prof. Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur 29 th July, 2008 Types of Matrices Matrix Addition and Multiplication

More information

PDS Lab (Assignment 1) Date: 31 st July, 2017 (2-6 pm)

PDS Lab (Assignment 1) Date: 31 st July, 2017 (2-6 pm) PDS Lab (Assignment 1) Date: 31 st July, 2017 (2-6 pm) (1) Write a C program to print your name. (2) Write a C program to convert the temparature from Fahrenheit to Celsius. Take the temparature in Fahrenheit

More information

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

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 1 (Minor modifications by the instructor) References C for Python Programmers, by Carl Burch, 2011. http://www.toves.org/books/cpy/ The C Programming Language. 2nd ed., Kernighan, Brian,

More information

DEPARTMENT - Mathematics. Coding: N Number. A Algebra. G&M Geometry and Measure. S Statistics. P - Probability. R&P Ratio and Proportion

DEPARTMENT - Mathematics. Coding: N Number. A Algebra. G&M Geometry and Measure. S Statistics. P - Probability. R&P Ratio and Proportion DEPARTMENT - Mathematics Coding: N Number A Algebra G&M Geometry and Measure S Statistics P - Probability R&P Ratio and Proportion YEAR 7 YEAR 8 N1 Integers A 1 Simplifying G&M1 2D Shapes N2 Decimals S1

More information

15 FUNCTIONS IN C 15.1 INTRODUCTION

15 FUNCTIONS IN C 15.1 INTRODUCTION 15 FUNCTIONS IN C 15.1 INTRODUCTION In the earlier lessons we have already seen that C supports the use of library functions, which are used to carry out a number of commonly used operations or calculations.

More information

o Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement

o Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement Last Time Let s all Repeat Together 10/3/05 CS150 Introduction to Computer Science 1 1 We covered o Counter and sentinel controlled loops o Formatting output Today we will o Type casting o Top-down, stepwise

More information