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 โ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.
Practice Sessions
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
Write a program for finding the max and min from the three numbers.
View Solution โWrite the program for the simple, compound interest.
View Solution โWrite a program to display the class awarded based on the percentage obtained by a student.
View Solution โWrite a program that prints a multiplication table for a given number and the number of rows in the table.
View Solution โWrite a program that shows the binary equivalent of a given positive number between 0 to 255.
View Solution โExpression Evaluation
A building is constructed at a height of h meters. A ball is thrown from the top of the building with an initial velocity of u m/s. Write a C program to find the velocity of the ball when it reaches the ground.
View Solution โ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 โWrite a program that finds if a given number is a prime number.
View Solution โWrite a C program to find the sum of individual digits of a positive integer and test given number is palindrome.
View Solution โ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 โWrite a C program to generate all prime numbers between 1 and n.
View Solution โWrite a C program to find the roots of a quadratic equation.
View Solution โWrite a C program to generate the terms of a fractional sequence.
View Solution โWrite a C program to generate a geometric progression.
View Solution โArrays, Pointers and Functions
Write a C program to find the minimum, maximum and average in an array of integers.
View Solution โWrite a C program to find the mean, variance and standard deviation of an array and sort the array.
View Solution โWrite a C program that uses functions to perform Addition of two matrices.
View Solution โWrite a C program that uses functions to perform Multiplication of two matrices.
View Solution โWrite a C program to find the transpose of a matrix using dynamically allocated memory.
View Solution โWrite a C program to find factorial of a number using recursive and non-recursive functions.
View Solution โWrite a C program to find the greatest common divisor of two numbers using recursive and non-recursive functions.
View Solution โWrite a C program to calculate x raised to the power of n using recursive and non-recursive functions.
View Solution โWrite a program for reading elements using a pointer into an array and display the values using the array.
View Solution โWrite a program for display values reverse order from an array using a pointer.
View Solution โWrite a C program to find the sum of n elements of an array using a pointer.
View Solution โFiles
Write a C program to display the contents of a file.
View Solution โWrite a C program which copies one file to another, replacing all lowercase characters with their uppercase equivalents.
View Solution โWrite a C program to count the occurrences of a given character in a text file using command line arguments.
View Solution โWrite a C program to create and update a binary file using fseek.
View Solution โ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
Write a C program to convert a Roman numeral in the range I to L into its decimal equivalent.
View Solution โWrite a C program to convert a number between 1 and 50 into its Roman numeral equivalent.
View Solution โWrite a C program that uses functions to insert a sub-string into a given main string from a given position.
View Solution โWrite a C program that uses functions to delete n Characters from a given position in a given string.
View Solution โ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 โ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 โWrite a C program to count the lines, words and characters in a given text.
View Solution โMiscellaneous
Write a menu-driven program to find the smallest, largest, sum and average of a given set of numbers.
View Solution โWrite a C program to construct pyramids using stars or numbers.
View Solution โSorting and Searching
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 โ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 โWrite a C program that implements the Bubble sort method to sort a given list of integers in ascending order.
View Solution โWrite a C program that sorts the given array of integers using selection sort in descending order.
View Solution โWrite a C program that sorts the given array of integers using insertion sort in ascending order.
View Solution โWrite a C program that sorts a given array of names.
View Solution โ