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
Define some Important Point for bit fields with structures? Only n lower bits will be assigned to an n bit number thus type cannot take values larger than 15 (4 bits long)
Given a bool variable isReadable write some statements that assign true to isReadable if the file "topsecret" exists and can be read by the program and assigns false to isR
C Program for Palindrome Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
A game is played with three piles of stones and two players. At her turn, a player removes one or more stones from the piles. However, if she takes stones from more than one pile,
You are to develop a Clinic System. 1. Identify and briefly explain the objects, classes, methods and attributes for the Clinic System. 2. Draw a use case diagram to represen
How to write an inline class member function In addition to global functions, you may request that non-static member functions of a class be inlined. The normal method of doin
BACKGROUND: FILE SYSTEMS In a computer, a file system (sometimes written filesystem) is the way in which files are named and where they are placed logically for storage and ret
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. The area under a curve between two points can b
If an array holds integer, each of which is four bytes long, how many bytes from the base location of the array is the location of the fifth element?
The break statement The break statement, which was already covered in the switch.. case, can also be used in the loops. When a loop statement is encountered in the loops the co
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