C Program to Convert Lowercase Characters by Uppercase and Vice-Versa

This is a C program to replace lowercase characters by uppercase & vice-versa. Problem Description This program accepts the sentence and replaces lowercase characters by uppercase & vice-versa. Problem Solution 1. Take the sentence as input. 2. Using (islower()? toupper():tolower()) function replace lowercase characters by uppercase & vice-versa. 3. Print the output and exit. Program/Source … Read more

advertisement

C Program to Check if a Matrix is a Sparse Matrix

Sparse matrix is a matrix with the majority of its elements equal to zero. However, there is no fixed ratio of zeros to non-zero elements. But it is believed that the number of 0’s should be strictly greater than half of the product of rows and columns in a matrix. Example 1: Given matrix: The … Read more

advertisement

Sum of Digits Program in C

Sum of digits in a C program allows a user to enter any number, divide that number into individual numbers, and sum those individual numbers. Example 1: Given number = 14892 => 1 + 4 + 8 + 9 + 2 = 24. Sum of digits of a given number “14892” is 24. Example 2: … Read more

advertisement

C Program to Read a String and Find the Sum of all Digits in the String

This is a C program to read a string and find the sum of all digits in the string. Problem Description This program takes a string containing both digits and alphabet as input and finds the sum of all digits in the string. Problem Solution 1. Take the string as input. 2. Check for the … Read more

advertisement

Calculator Program in C

A calculator is a device used to perform mathematical operations on numbers. Simple calculators can only perform the basic mathematical operations of addition, subtraction, multiplication, and division. In this article, we will explain a simple calculator program in C with an example. Problem Solution 1. Declare the variables. 2. Get the two numbers from the … Read more

advertisement

C Program to Accept the Height of a Person & Categorize as Taller, Dwarf & Average

This C program accepts the height of a person & categorize as taller, dwarf & average. Problem Description This program accepts the height of a person as input and categorizes as taller, dwarf & average. Problem Solution 1. Take the height of a person as input. 2. Using if,else statements, categorize it as taller, dwarf … Read more

advertisement

C Program to Read a Grade and Display the Equivalent Description

This C program reads a grade and displays its equivalent description. Problem Description This program takes a grade as input and displays its equivalent description. Problem Solution 1. Take the grade as input. 2. Use switch statement to verify the grade. 3. Print the output and exit. Program/Source Code Here is source code of the … Read more

advertisement

C Program to Interchange Any Two Rows and Columns in the Matrix

This C Program interchanges any two rows & columns in the given matrix. The program swaps the values of any 2 rows and columns. Here is source code of the C program to interchanges any two rows & columns in the given matrix. The C program is successfully compiled and run on a Linux system. … Read more

advertisement

C Program to Calculate the Sum of cos(x) Series

This is a C Program to calculate the sum of cos(x) series. Problem Description This C Program calculates the sum of cos(x) series. Problem Solution Take input from the user and perform operations as shown in the program below. Program/Source Code Here is source code of the C program to C Program calculates the sum … Read more

advertisement

C Program to Multiply Number by 4 using Bitwise Operators

This is a C Program to multiply given number by 4 using bitwise operators. Problem Description This C Program multiplies given number by 4 using bitwise operators. Problem Solution The bitwise operators are or, and, xor, not, left shift, right shift. Program uses left shift operator for this. Program/Source Code Here is source code of … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.