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

Create a software application, Project Description: Currently seeking so...

Project Description: Currently seeking someone who can create me a software application (google chrome crx file_ that will auto add all shoe sizes to cart directly and if not av

Write a program of inline function, Here is a program that uses an inline f...

Here is a program that uses an inline function to compute and return the absolute value of its input argument. # include inline int abs(int x) {                  ret

Inside and outside type casting, depth description of the inside and outsid...

depth description of the inside and outside typecasting

Decode the code, smugglers are becoming very smart day by day. Now they hav...

smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

D, drawbacks in assignments in engeenirng

drawbacks in assignments in engeenirng

Is there present a way to force new to allocate memory, Yes. "Memory pools"...

Yes. "Memory pools" are useful in many situations. The bad news is that I'll need to drag you through the mire of how it acts before we talk about all the uses. Firstly, recall

Store first n natural no in a file - c program, Program is to store first n...

Program is to store first n natural no in a file: Write a program to  store first n natural no in a file void main()     {     fstream file;     file.open("studen

Procedure to compute recursive and iterative process, Consider the followin...

Consider the following mathematical function: (a) Write a procedure that computes f by means of a recursive process (b) Write a procedure that computes f by means of an

Algorithm , write an algorithm to swap values without using third variable

write an algorithm to swap values without using third variable

C program for string operations, Aim: To implement a program for following...

Aim: To implement a program for following string operations: Length of String. String Concatenation. Substring (provide start index and length) Find character 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