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

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

 

 

Posted Date: 9/10/2012 7:45:51 AM | Location : United States







Related Discussions:- C program for even & odd no in any matrices , Assignment Help, Ask Question on C program for even & odd no in any matrices , Get Answer, Expert's Help, C program for even & odd no in any matrices Discussions

Write discussion on C program for even & odd no in any matrices
Your posts are moderated
Related Questions
Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

Write a function that takes in a radius and evenly covers the screen with circles of that radius. Don't attempt to draw any circles that are completely off the screen.

Project Description: Need someone to prepare a trading platform and sophisticated trading strategy. Must have knowledge and experience in most of these: QuickFIX, Esper, Quan


A: no, can't. The names of, precedence of, associativity of, and arity of operators is fixed through the language. In C++, there is no operator** so you cannot create one for a

Buddy systems : A method of handling the storage management problem is kept individual free lists for blocks of dissimilar sizes. Every list having free blocks of only one particul

Problem Statement: You have to write a C program to develop a Car Parking Management System for a busy commercial area. The system will record the car plate number, date and time w

Write a program to define a matrix: 1. Write a function that takes an integer and calculates and returns the factorial of the integer. The Factorial of a number "n" is compute

c program to construct a structure: struct sensus                 {                                 char name[30];                                 long int population;

HWID Spoofer for Windows 7, 8 x64 Project Description: I want a simple program that will spoof my hardware id. I should be able to prepare the id to spoof to in the program a