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

Assignment, Hi, Can i get a quote for my Programming assignment

Hi, Can i get a quote for my Programming assignment

Assignment, Programming Assignment # 1 C and UNIX   The purpose of this ...

Programming Assignment # 1 C and UNIX   The purpose of this assignment is to get you more familiar with Unix/Linux and those constructs of C that are not part of C++. Write a C

#title minimization and maxmization assignment problem, how we can code in ...

how we can code in c++ for assignment problem (operation research) method to mkinimization and mamization

Define the system oriented data files, Define the System Oriented Data File...

Define the System Oriented Data Files? System-oriented data files are further closely related to the computer's operating system than Stream- oriented data files and they are s

What is inheritance, What is inheritance? Class, the vehicle, which is ...

What is inheritance? Class, the vehicle, which is used to execute object-oriented concepts in C++, has given a new dimension to this idea of reusability. Many vendors now offer

Recursion, #questiowrite a program to calculate e^x

#questiowrite a program to calculate e^x

Program to define simulation method, This problem familiarizes you with usi...

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of π using a simulation method called "Monte Carlo". The following fi

Record of student and calculating marks using ctotal, reocord of a student ...

reocord of a student and a function ctotal to calculate the marks of any three subject by using ctotal() function

Stack, c++ program to to implement multiple stacks using single array

c++ program to to implement multiple stacks using single array

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