• Q4. Draw the flowchart depicting the solution of question 3. Ans.

• Q2. Draw a flowchart to represent the logic of solution of question 1. Ans.

• Q9. Write an algorithm that inputs a (upto) 6 digit integer value and checks whether the given value is palindrome or not. (examples of palindrome value are 43134, 51115, 2332) Ans. Integer num, mod, newnum, copynum; newnum<-0; print ‘Enter a number: ‘; read num; copynum<-num; while(num) //while(num>0)

• Q8. Write an algorithm that allows a user to enter an integer value of upto 5 digits and prints the reversed number. (For example, if the user enters 4319 then the result should be 9134.) Ans. Integer num, mod, newnum; newnum<-0; print ‘Enter a number: ‘; read num; while(num)

• Q7. Obtain an algorithm to print number from 160 to 1, that is, in reverse order. Ans. Integer num; num<-160; print ‘The number from 160 to 1, that is, in reverse order are:\n’; while(num>0) //while(num)

• Q6. Write an algorithm to print the table of a given number n. Ans. Integer num, counter; print ;Enter the number you want to print the table of: ‘; read num; for(counter<-1;counter<=10;counter<-counter+1) {

• Q5. Given hundred pairs of length and breadth of rectangles, obtain a C program to find all the rectangles whose area is greater than their perimeters. (For example, the area of the rectangle with length = 5 and breadth = 4 is greater than its perimeter.) Ans. Float length, breath, area, perimeter; Integer counter; for(counter<-0;counter<100;counter<-counter+1) { print ‘Enter length and breath: ‘; read length, breath;

• Q3. Given a set of 125 integers, write an algorithm which will find The total number of odd integers in the set The sum of all integers. Ans. Integer count, sum, i, num; sum<-0; count<-0; i<-0; while(i<125) {

• Q1. Write an algorithm to find the minimum quotation from a set of n quotations. Ans. Integer num, mini, quot, counter; print ‘How many quotations: ‘; read num; print ‘Enter first quotation: ‘; read quot; mini<-quot; for (counter<-1;counter<num;counter<-counter+1)

• Q4. How does the efficiency of a program depend upon the algorithm? Ans. A program is the expression of an algorithm in a programming language. Thus, the success of a program depends upon the algorithm.