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

Assignment Help:

 

#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

 


Related Discussions:- C program for the no are in ascending order

Luminous jewel - a polishing game, Byteland county is very famous for lumin...

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. Nec

C program to print fibonacci series, C program to print fibonacci series: ...

C program to print fibonacci series: int fibo(long int); void main() {                 long int a=0,n;                 printf ("how many terms\n");

Influence on Social media - for Geek''s, Recently social media has been flo...

Recently social media has been flooded by fb posts, tweets, news articles about only thing demonetization.A great debate is ongoing over it. Most of the people discussing in social

MCQ, in a multilist organisation

in a multilist organisation

Data structure, convert BST into sorted doubly linked list

convert BST into sorted doubly linked list

List, Is there any difference between List x; and List x ()? Can you please...

Is there any difference between List x; and List x ()? Can you please provide me assignment help.

C program for reverse the word in string, C Program for REVERSE THE WORD IN...

C Program for REVERSE THE WORD IN STRING #include conio.h> #include stdio.h> #include string.h> void main() {           char a[50],b[25][25],temp;           i

Arrays, Write two different arrays. Store the names in it and then compare ...

Write two different arrays. Store the names in it and then compare if both the names entered by the user are the same.

Operator overloading, Op e r a t o r O v e r l o a d i n g :...

Op e r a t o r O v e r l o a d i n g : W h e n   a n   o p e r a t o r   i s   u s e d   f o r   d i ff e r e n t   op e r a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd