Menu

Programming for Problem Solving [ Lab Manual ]


[R22] B-Tech I Year I Semester (1-1) CSE, CSE(AIML), CSE(DS) & IT Programming for Problem Solving Lab Manual JNTU Hyderabad (JNTUH).


This tutorial provides Lab Programs on various topics of Programming for Problem Solving. It includes basic of C, Simple numeric problems, Expression Evaluation, Arrays, Pointers and Functions, Strings, Files, Miscellaneous, Sorting and Searching and etc., .

Programming for Problem Solving Lab Programs


   Practice sessions:
1. Write a simple program that prints the results of all the operators available in C (including pre/ post increment , bitwise and/or/not , etc.). Read required operand values from standard input View Solution
2. Write a simple program that converts one given data type to another using auto conversion and casting. Take the values from standard input. View Solution
   Simple numeric problems:
1. Write a program for finding the max and min from the three numbers. View Solution
2. Write the program for the simple, compound interest. View Solution
3. Write a program that declares Class awarded for a given percentage of marks, where mark <40%= Failed, 40% to <60% = Second class, 60% to <70%=First class, >= 70% = Distinction.Read percentage from standard input. View Solution
4. Write a program that prints a multiplication table for a given number and the number of rows inthe table. For example, for a number 5 and rows = 3, the output should be:
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
View Solution
5. Write a program that shows the binary equivalent of a given positive number between 0 to 255 View Solution
   Expression Evaluation
1. A building has 10 floors with a floor height of 3 meters each. A ball is dropped from the top of the building. Find the time taken by the ball to reach each floor. (Use the formula s = ut+(1/2)at^2where u and a are the initial velocity in m/sec (= 0) and acceleration in m/sec^2 (= 9.8 m/s^2)). View Solution
2. Write a C program, which takes two integer operands and one operator from the user, performs the operation and then prints the result. (Consider the operators +,-,*, /, % and use Switch Statement) View Solution
3. Write a program that finds if a given number is a prime number View Solution
4. Write a C program to find the sum of individual digits of a positive integer and test given numberis palindrome View Solution
5. A Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0 and 1. Subsequent terms are found by adding the preceding two terms in the sequence. Writea C program to generate the first n terms of the sequence. View Solution
6. Write a C program to generate all the prime numbers between 1 and n, where n is a value supplied by the user View Solution
7. Write a C program to find the roots of a Quadratic equation. View Solution
8. Write a C program to calculate the following, where x is a fractional value.i. 1-x/2 +x^2/4-x^3/6 View Solution
9. Write a C program to read in two numbers, x and n, and then compute the sum of this geometric progression: 1+x+x^2+x^3+..............+x^n. For example: if n is 3 and x is 5, then the program computes 1+5+25+125. View Solution