Home » C PROGRAM

Category Archives: C PROGRAM

C PROGRAM TO PRINT COPY CONCATENATE STRING

A string is a character array which stores characters as an Integer is stored in Integer array. Each string is terminated by a null denoted by “\0”. The null character “\0” tells the function where the string is ended. (more…)

C PROGRAM TO DELETE ALL VOWELS FROM STRING

// C PROGRAM TO DELETE ALL VOWELS FROM STRING

// DATE: 09-07-2015

#include<stdio.h>

#include<conio.h>

#include<string.h> (more…)

C PROGRAM TO PRINT REVERSE OF STRING

// C PROGRAM TO PRINT REVERSE OF STRING

// DATE: 06-07-2015

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main() (more…)

C PROGRAM FOR MATRIX OPERATIONS

C PROGRAM FOR MATRIX ADDITION SUBTRACTION AND MULTIPLICATION

In this C program three basic operations of Matrix such as Matrix Addition, Matrix Subtraction and Matrix Multiplication is done. In this Program matrix1, matrix2 and matrix3 are 2 dimensional arrays variables. Each 2D array has same dimension. row1 and column1 are dimension of matrix1[5][5] and row2 and column2 are dimension of matrix2[5][5]. Variable matrix3[5][5] stores the result of different matrix operations. Addition and Subtraction of two matrices will be possible if row1 is equal to row2 and column1 is equal to column2. Multiplication of the Matrices will be possible when column1 is equal to row2. (more…)

FIBONACCI SERIES C PROGRAM

C PROGRAM TO GENERATE FIBONACCI SERIES USING IF-ELSE-IF:

The given C program generates Fibonacci Series of Numbers using if-else-if conditional statement.

#include<stdio.h>

#include<conio.h>

void main()

{

            int terms, a, b, c, i; (more…)

SORTING PROGRAMS

Sorting is the technique of arranging a list of N elements stored in memory. Here sorting of elements of list can be either in ascending order or in descending order. For example suppose an unsorted array of numbers is as follows:

11
88
44
22
55
77
99
33
66
110
This is an unsorted array. It can be either sorted in ascending order or in descending order.
If this array is sorted in ascending order then it is as follows:
11
22
33
44
55
66
77
88
99
110
And if this array is sorted in descending order then it is as follows:
110
99
88
77
66
55
44
33
22
11
The sorting of elements of this array can be achieved in many way or it can be said that there are a number of method that can be used for sorting. The different methods of sorting are listed below and each technique is discussed separately.

(more…)

C PROGRAM TO SWAP TWO STRINGS

Swapping means interchanging contains of two variables. Now swapping of strings mean exchanging the word or letter stored in two variables. For example if a variable x contains a name Ram and another variable y contains a name Rohan then after swapping variable x will contain Rohan and variable y will contain Ram. Three different approaches are used here swapping. In each approach input is take using formatted input specification. In each program the length of each string is defined as MAX with a value of 10.

C PROGRAM TO SWAP TWO STRINGS USING WHILE LOOP:

This program is written using while loops and swapping is done using a third string variable temp. First while loop is used to copy contain of variable str1 to variable temp. Second while loop is used to copy contain of variable str2 to variable str1 and third while loop is used to copy contain of variable temp to variable str2. Now the swapping is done. Output is printed using formatted output specification.   .
// C PROGRAM TO SWAP TWO STRINGS USING WHILE LOOP
// DATE: 26-07-2015
#include<stdio.h>
#include<conio.h>
#define MAX 10
void main()
{

(more…)