Interchanging Odd & Even Numbers In C Program Tamil


//	12 34 45 56 67 7 8 78 87 54 12
#include<stdio.h>
#include<conio.h>
void main()
{
	int num[]={1,2,3,4,5,6,7,8,9,10};
	int i,t;
	clrscr();
	printf("\n Before Interchange :");
	for(i=0;i<=9;i++)
	{
		printf("%d\n",num[i]);
	}
	for(i=0;i<=9;i=i+2)
	{
		t=num[i];	// i=0
		num[i]=num[i+1];
		num[i+1]=t;
	}
	printf("\n After Interchange :");
	for(i=0;i<=9;i++)         // www.tuotrjoes.com
	printf("\n%d",num[i]);
	getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming