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 Bitwise Left Shift and Right Shift Operators: >? The bitwise shift operators shift their first operand right (>>) or left ( // Illustration of the bitwise right shi
(a) Write a fragment of code that declares a variable colSp of type ColourSpot, and then moves it to the point (3, -4), and sets its colour to Green. (b) A function QU8 is speci
Question : (a) Define the following Object-Oriented terms: (i) Encapsulation (ii) Inheritance (iii) Abstraction (iv) Polymorphism. (b) What are objects in Lingo progra
(a) Write a procedure called (mult x y) that multiplies two numbers x and y in a recursive manner using successive addition. Specifically, note that a x b = a + a + .... + a (b tim
Project Description: Not just like that though. I want a similar program that can scan through poker lobbys (pokerstars, full tilt, ongame and ipoker) and seat me to the left of
Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec
For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t
Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules. a. A call made between 8:00 AM and 6:
find the minimum shelf
Project Description: We are looking to have software that we will use to track employee information regarding our wellness program. We would like the system to be able to follow
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