Swap Array Values In C Program Tamil


#include<stdio.h>
#include<conio.h>
void main()
{
      int i,s,n,a[100];
      clrscr();
      printf("\nEnter the limit :");
      scanf("%d",&n);
      printf("\nEnter the numbers :");
      for(i=0;i<n;i++)
      {
	 scanf("%d",&a[i]);            //www.tutorjoes.com
      }
      for(i=0;i<n;i=i+2)
      {
	s=a[i];
	a[i]=a[i+1];
	a[i+1]=s;                      //www.tutorjoes.com
      }
      for(i=0;i<n;i++)
      {
	printf("\n%d",a[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