C program for even & odd no in any matrices , C/C++ Programming

Assignment Help:

C Program for EVEN & ODD NO IN ANY MATRICES

#include stdio.h>

#include conio.h>

void main()

{

          int a[100][100];

          int i=0,j=0,r,c,even=0,odd=0;

          clrscr();

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

          {

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

                             a[i][j]=0;

          }

          i=0;    j=0;

          printf("\nENTER THE NO OF ROWS: ");

          scanf("%d",&r);

          printf("\nENTER THE NO OF COLS: ");

          scanf("%d",&c);

          for(i=0;i

          {

                   for(j=0;j

                   {

                             printf("\nENTER THE ELEMENTS: ");

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

                   }

          }

          for(i=0;i

          {

                   for(j=0;j

                   {

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

                             if(a[i][j]%2==0)

                                      even++;

                             else

                                      odd++;

                   }

                   printf("\n");

          }

          printf("\nTHE EVEN NO ARE %d",even);

          printf("\nTHE  ODD NO ARE %d",odd);

 

          getch();

}

OUTPUT :

ENTER THE NO OF ROWS : 2

ENTER THE NO OF COLS  : 2

ENTER THE ELEMENTS : 1

ENTER THE ELEMENTS : 5

ENTER THE ELEMENTS : 3

ENTER THE ELEMENTS : 4

1          5

3          4

THE EVEN NO ARE: 1

THE   ODD NO ARE: 3

 

 


Related Discussions:- C program for even & odd no in any matrices

What do you signify by stack unwinding?, A: this is a procedure during exce...

A: this is a procedure during exception handling while the destructor is called for all local objects in the stack among the place where the exception was thrown & where this is ca

C program to maintain database of employees, Aim: To implement a program t...

Aim: To implement a program to maintain information of employees in an educational institute using inheritance. Code:                       class staff {

Require flowchart, I require a flowchart for push , & pop operation on stac...

I require a flowchart for push , & pop operation on stack using array

Wap avgerage score-assignment- standard deviation of student, finds the ave...

finds the average for all assignments for an individual student float getAverageForStudent(float scores[20][10], int student, int numAssignments) {  }  // finds the average for

CptS 121 Program Development & Design program design in C, Write a program...

Write a program that performs character processing on 10 characters read in from a file, and writes the results to output files. Do NOT use loops or arrays to solve this problem. N

Quick Homework, Write three functions in C or C++: one that declares a larg...

Write three functions in C or C++: one that declares a large array statically, one that declares the same large array on the stack, and one that creates the same large array from t

Arrays within a class, A r r a y s w i t h i n a c l a s s:...

A r r a y s w i t h i n a c l a s s: I t i s j u s t d ecl a r i n g o r c on s t ru c ti n g a d e r i v e d t

If/else statement, to compute the net pay of an emplyee, given his/her pay ...

to compute the net pay of an emplyee, given his/her pay rate, number of hours and tax rate

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