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

Similar documents
PROGRAMMING IN C AND C++:

Examples for Algorithm,Pseduocode,Flowchart

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

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

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

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE

Downloaded from

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

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

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

Subject: Computer Science

Math 083 Final Exam Practice

Module 2: Classical Algorithm Design Techniques

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

Loops / Repetition Statements

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

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:

Suggestive List of C++ Programs

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

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

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

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

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

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

COMPUTER PROGRAMMING LAB

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

Chapter 3 Problem Solving and the Computer

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

Alignment to the Texas Essential Knowledge and Skills Standards

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

Computer Programming C++ (wg) CCOs

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

AC64/AT64 DESIGN & ANALYSIS OF ALGORITHMS DEC 2014

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

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

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

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

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

Practical List of. MCA IV SEM Session -2010

Assertions & Verification & Example Loop Invariants Example Exam Questions

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 ).

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

Assertions & Verification Example Exam Questions

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,

CS1100 Introduction to Programming

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

MODULE 2: Branching and Looping

Introduction to Computer Science Midterm 3 Fall, Points

Names and Functions. Chapter 2

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

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

Chapter 1: Number and Operations

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

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

3 The L oop Control Structure

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal

COP 4516: Math for Programming Contest Notes

UNIT- 3 Introduction to C++

CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK

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

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

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

Programming Questions and Solutions in Java (15CS561)

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

Haskell through HUGS THE BASICS

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

Precalculus Notes Unit 1 Day 1

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

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

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

Question Bank (SPA SEM II)

4751 (C1) Introduction to Advanced Mathematics

RtI 7. Curriculum (219 topics additional topics)

11.3 Function Prototypes

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

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

CS111: PROGRAMMING LANGUAGE II

Basic and Intermediate Math Vocabulary Spring 2017 Semester

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

UNIT 3: ANALYSIS OF SIMPLE ALGORITHMS

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

Computer Programming CS F111

COMP171 Data Structures and Algorithms Fall 2006 Midterm Examination

APS Sixth Grade Math District Benchmark Assessment NM Math Standards Alignment

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

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

Functions. Arash Rafiey. September 26, 2017

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

An introduction to Scheme

Computer System and programming in C

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

Course Outline. Introduction to java

KLiC C Programming. (KLiC Certificate in C Programming)

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

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

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

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

15 FUNCTIONS IN C 15.1 INTRODUCTION

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

Transcription:

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

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

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

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

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

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

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