Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
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
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
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
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
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
For your class to work properly, you'll need to define appropriate constructors, extract and insert operators, and of course arithmetic operators. (If you wanted to use it as a gen
Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.
What does ODBC do in context with PHP? PHP supports many databases such as dBase, Microsoft SQL Server, Oracle, etc. however, it also supports databases such as filePro, FrontB
The files are meteorological radar data whose decompression is badly needed for relative study. Please contact Kathy Lee (Email: ; Cell phone: 0086 15701799056) or Mr. Zhu (Email:
Structures A structure is a derived data type. It is a combination of logically related data items. Unlike arrays, which are a collection of such as data types, structures can
Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given
what is an array?
Aim: To implement a program to swap two numbers using reference arguments. Code: void swap(int *a, int *b) { int temp; temp=*a;
What is the use of PEAR in php? PEAR is termed as PHP Extension and Application Repository. It provides structured library to PHP users and also gives provision for package mai
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.
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!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd