Basic C Program Examples

C Program Examples
C program to generate random number
C program to generate random number

Random numbers are numbers that occur in a sequence such that two conditions are met: (1) the values are uniformly distributed over a defined interval or set, and (2) it is impossible to predict future values based on past or present ones. Random numbers are important in statistical analysis and probability theory. After the successful compilation of the program, this program displays the following output: Ten random numbers in range [1-100] are as follows: 42, 68, 35, 1, 70, 25, 79, 59, 63, 65

C Program Examples
C program string palindrome
C program string palindrome

In the successful compilation of the program, a message is displayed on the screen as Please! Enter a string to check if it's a palindrome:This program entered a string by user then store it into a variable after that found its reversed and store it in to another variable if both variables are same then we can say that inputed string is palindrome otherwise that is not a palindrome.

C Program Examples
C program to check number is palindrome
C program to check number is palindrome

In the successful compilation of the program, a message is displayed on the screen as Please! Enter an integer:This program entered a number by user then store it into a variable after that found its reversed and store it in to another variable if both variables are equal then we can say that inputed number is palindrome otherwise that is not a palindrome.

C Program Examples
C program to get square root of a number
C program to get square root of a number

Number is an arithmetical value, expressed by a word, symbol, or figure, representing a particular quantity and used in counting and making calculations. This program allows the user to enter any number and then finds the square root of that number using math function sqrt () This program uses the math function findSQRT(int number) to find the square root of a number. As we all know √number = number½.

C Program Examples
c program sum of digits
c program sum of digits

Number is an arithmetical value, expressed by a word, symbol, or figure, representing a particular quantity and used in counting and making calculations. In this Program first of all User Enter the an integer number then Program display the sum of digits of inputed number as an output.

C Program Examples
C program to find area of circle
C program to find area of circle

A circle can be defined as a locus (a set of points in a particular position) of points that maintain equidistant from another point called the center. In this Program first of all User Enter the radius of the circle then it shows the area of the circle according to the given radius by using formula. Area is always squarely proportional to the radius.

C Program Examples
C program for matrix addition
C program for matrix addition

This Program shows matrix addition through the addition of corresponding elements of the matrices.

C Program Examples
c program to multiply two matrices
c program to multiply two matrices

This Program multiply the elements of the two 3 x 3 matrices.

C Program Examples
C program to print pascal triangle
C program to print pascal triangle

Pascal Triangle is named as the Mathematician Blaise Pascal. This Program shows a Pascal Triangle in front of you as a output.

C Program Examples
C program to insert an element in an array
C program to insert an element in an array

This Program insert 50 at 4th index to the given array.

Write For Us.

Contribute the Community.