C Program to Swap Two Numbers

Swapping two numbers in C programming means swapping the values of two variables. For example, there are two variables m & n. Value of m is “2” & value of n is “3”. Before Swapping: m value = 2; n value = 3 After Swapping: m value = 3; n value = 2 Problem Description … Read more

advertisement

String Palindrome Program in C

String Palindrome Program in C: A palindrome is a word, phrase or sentence that reads the same backward or forward. A string is said to be a palindromic string when we traverse it from start to end or end to start then we get the same result. Examples: ada, malayalam, racecar, mom, etc. In simple … Read more

advertisement

C Program to Find Sum of Array Elements using Pointer

This is a C program to calculate sum of array elements using pointer. Problem Description We have to write a program in C such that it calculates the sum of elements of an array using pointers. The program should dynamically allocate a piece of memory for that array and use a pointer to point to … Read more

advertisement

C program to Insert an Element in the Sorted Array

This is a C Program to insert an element in a specified position in a given array. Problem Description This program implements a one dimentional array, sorts it and then takes a user input and inserts the desired element in the specified position of a one dimentional array and print all the elements of the … Read more

advertisement

C Program to Convert Binary to Decimal

Binary Number System: The binary number system also known as base 2 number system was invented in 1689 by Gottfried Leibniz it contains two symbol 0 and 1. The base 2 number system is a positional notation with radix of 2. Each of the digit is called as Bit. Decimal Number System: The decimal number … Read more

advertisement

C program to Find Largest and Second Largest Elements in Array

This is a C Program to calculate the largest two numbers in a given Array. Problem Description We have to write a program in C such that the program will read the elements of a one-dimensional array, then compares the elements and finds which are the largest two elements in a given array. Expected Input … Read more

advertisement

C Program to Find the Frequency of Odd and Even Numbers in Matrix

This is a program to find the frequency of odd & even numbers in the given matrix. Problem Description This C Program finds frequency of odd & even numbers in the given matrix. The program first accepts the matrix. Then finds the odd and even numbers in a matrix. Then finds the occurrence of odd … Read more

advertisement

Sum of First N Natural Numbers in C

Problem Description: Write a C program to find the sum of first n natural numbers. What is a Natural Number? Natural numbers are all positive integers ranging from 1 to n or infinity. Sum of first n natural number, for any number n, sum is defined as 1+2+3—-n, which is an arithmetic series whose sum … Read more

advertisement

C Program to Find the Roots of a Quadratic Equation

Roots of a Quadratic Equation in C: The roots/Solutions of the quadratic equation ax2 + bx + c = 0 are the values of the variable x that satisfy the equation. This means finding the value of x such that the whole equation sums to 0. Because the degree (*HIGHEST POWER OF A VARIABLE) of … Read more

advertisement

C Program to Count the Number of Vowels and Consonants in a Sentence

This is a C program to count the number of vowels & consonants in a sentence. Problem Description This program takes the sentence as input and counts the number of vowels & consonants in a sentence. Problem Solution 1. Take the sentence as input. 2. Using for loop and if,else statements check for vowels, consonants … 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.