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
A name clash happens when a name is described in more than one place. For example, two dissimilar class libraries could give two different classes the similar name. If you try to u

Explain the Formatted Input Output with Strings? These are the third set of the scanf and printf families. They are called sscanf and sprintf. sprintf Puts formatted dat

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

THIS PROGRAM IS TO DISPLAY A STOCK CONTAINING ITEM CODE,ITEM NAME,PRICE AND ANOTHER STOCK WITH CODE & QUANTITY AND DISPLAY COMPLETE INFORMATION #include #include #include

Give practice in writing program''s..

write a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits a and b

pls say code for this above..

1. Using Visual C++ and your OpenGL configured environment, write an application that displays a “unique” graphical scene that you designed and coded for this course. What yo

i havea a small C++ i need help with. should not be anything special for an experienced programmer