C program for the no are in ascending order , C/C++ Programming

 

#include stdio.h>

#include conio.h>

#include string.h>

void main()

{

          int i=0,j=0,k=0,l=0;

          int a[3][3],temp[3][3];

          clrscr();

          for(i=0;i<3;i++)

          {

                   for(j=0;j<3;j++)

                   {

                             a[i][j]=0;

                             temp[i][j]=0;

                   }

          } i=0;j=0;

          for(i=0;i<3;i++)

          {

                   for(j=0;j<3;j++)

                   {

                             printf("ENTER THE VALUE %d %d: ",i+1,j+1);

                             scanf("%d",&a[i][j]);

                   }

          }

          for(i=0;i<3;i++)

          {

                   for(j=0;j<3;j++)

                   {

                             for(k=0;k<3;k++)

                             {

                                      for(l=0;l<3;l++)

                                      {

                                                if(a[i][j]

                                                {

                                                          temp[i][j]=a[i][j];

                                                          a[i][j]=a[k][l];

                                                          a[k][l]=temp[i][j];

                                                }

                                      }

                             }

                   }

          }

          printf("\nNO ARE IN ACCENDING ORDER");

          printf("\n");

          for(i=0;i<3;i++)

          {

                   for(j=0;j<3;j++)

                             printf("%d\t",a[i][j]);

                   printf("\n");

          }

          getch();

}

 

OUTPUT :

ENTER THE LIMIT OF ELEMENTS: 3

ENTER THE NO 1 : 2  ENTER THE NO 2 : 3

ENTER THE NO 3 : 4

THE EVEN NO.S ARE 2  THE ODD NO.S ARE 1

THE TOTAL OF EVEN NO IS 6

THE TOTAL OF ODD NO IS 3

THE AVG. OF ALL EVEN NO IS 3.0000

THE AVG. OF ALL ODD NO IS 3.0000

 

Posted Date: 9/10/2012 7:44:22 AM | Location : United States







Related Discussions:- C program for the no are in ascending order , Assignment Help, Ask Question on C program for the no are in ascending order , Get Answer, Expert's Help, C program for the no are in ascending order Discussions

Write discussion on C program for the no are in ascending order
Your posts are moderated
Related Questions
What is the difference among const char *myPointer and char *const myPointer?  A: Const char *myPointer is a non constant pointer to constant data; whereas char *const myPointer

write a program that can accept numbers and perform all the four arithmetic operation

what is a string?

write a c program chat illustrates the creation of child process using fork system call. One process finds sum of even series and other process finds sum of odd series.

full coding for lcm in c++

Many modern cryptography algorithms require two numbers that are coprime, or sometimes referred to as relatively prime. Two numbers are coprime if their greatest common divisor is

Spider webs have two types of silk, sticky silk and strength silk, spiders do not move on the sticky silken threads only on the strength threads. Assume one type of spider creates

The ability to verify at run time the type of an object by using the typed operator or the dynamic_cast operator.

within 2 mins give me answer pllzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

#Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Ne