๐Ÿ’ป
B.TECH I YEAR โ€ข I SEMESTER

Programming for Problem Solving - Lab Manual

R25 Lab Manual โ€ข C Programming Practice Programs

LAB MANUAL

Programming for Problem Solving Lab Programs

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.

๐Ÿ”ข

Simple Numeric Problems

4 Programs
03

Write a program that prints a multiplication table for a given number and the number of rows in the table.

View Solution โ†’
04

Write a program that shows the binary equivalent of a given positive number between 0 to 255.

View Solution โ†’
โž—

Expression Evaluation

4 Programs
01

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 โ†’
03

Write a C program to find the sum of individual digits of a positive integer and test given number is palindrome.

View Solution โ†’
04

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. Write a C program to generate the first n terms of the sequence.

View Solution โ†’
๐Ÿงฎ

Arrays, Pointers and Functions

5 Programs
04

Write a program for reading elements using a pointer into an array and display the values using the array.

View Solution โ†’
๐Ÿ“

Files

2 Programs
01

Write a C program which copies one file to another, replacing all lowercase characters with their uppercase equivalents.

View Solution โ†’
02

Write a C program to merge two files into a third file (i.e., the contents of the first file followed by those of the second are put in the third file).

View Solution โ†’
๐Ÿ”ค

Strings

5 Programs
01

Write a C program that uses functions to insert a sub-string into a given main string from a given position.

View Solution โ†’
02

Write a C program that uses functions to delete n Characters from a given position in a given string.

View Solution โ†’
03

Write a C program to determine if the given string is a palindrome or not (Spelled same in both directions with or without a meaning like madam, civic, noon, abcba, etc.).

View Solution โ†’
04

Write a C program that displays the position of a character ch in the string S or โ€“ 1 if S doesnโ€™t contain ch.

View Solution โ†’
๐Ÿ”

Sorting and Searching

6 Programs
01

Write a C program that uses non-recursive function to search for a Key value in a given list of integers using linear search method.

View Solution โ†’
02

Write a C program that uses non-recursive function to search for a Key value in a given sorted list of integers using binary search method.

View Solution โ†’
03

Write a C program that implements the Bubble sort method to sort a given list of integers in ascending order.

View Solution โ†’
04

Write a C program that sorts the given array of integers using selection sort in descending orde.

View Solution โ†’
05

Write a C program that sorts the given array of integers using insertion sort in ascending order.

View Solution โ†’