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 FIND EVEN & ODD NO.S IN THE ARRAY
#include stdio.h>
#include string.h>
#include conio.h>
void main()
{
int i=0,j=0, l_e[100],l_o[100];
int a[100],odd=0,even=0,sum_even=0,sum_odd=0;
float avg_e=0,avg_o=0;
for(i=0;i<100;i++)
a[i]=0;
l_e[i]=0;
l_o[i]=0;
}
i=0; clrscr();
printf("\nENTER THE LIMIT OF ELEMENTS: ");
scanf("%d",&j);
for(i=0;i { printf("\nENTER THE NO %d: ",i+1); scanf("%d",&a[i]); if(a[i]%2==0) { sum_even=sum_even+a[i]; even++; avg_e=sum_even/even; l_e[i]=a[i]; } else { sum_odd=sum_odd+a[i]; odd++; avg_o=sum_odd/odd; l_o[i]=a[i]; } } i=0; printf("\nTHE EVEN NO.S ARE %d",even); printf("\nTHE ODD NO.S ARE %d",odd); printf("\nTHE TOTAL OF EVEN NO.S ARE %d",sum_even); printf("\nTHE TOTAL OF ODD NO.S ARE %d",sum_odd); printf("\nTHE AVERAGE OF ALL EVEN NO.S IS %f",avg_e); printf("\nTHE AVERAGE OF ALL ODD NO.S IS %f",avg_o); getch(); } OUTPUT : ENTER THE NO 1 1 : 2 ENTER THE NO 1 2 : 6 ENTER THE NO 1 3 : 3 ENTER THE NO 2 1 : 4 ENTER THE NO 2 2 : 7 ENTER THE NO 2 3 : 8 ENTER THE NO 3 1 : 9 ENTER THE NO 3 2 : 1 ENTER THE NO 3 3 : 2 NO ARE IN ASCENDING ORDER 1 2 2 3 4 6 7 8 9
printf("\nENTER THE NO %d: ",i+1);
scanf("%d",&a[i]);
if(a[i]%2==0)
sum_even=sum_even+a[i];
even++;
avg_e=sum_even/even;
l_e[i]=a[i];
else
sum_odd=sum_odd+a[i];
odd++;
avg_o=sum_odd/odd;
l_o[i]=a[i];
} i=0;
printf("\nTHE EVEN NO.S ARE %d",even);
printf("\nTHE ODD NO.S ARE %d",odd);
printf("\nTHE TOTAL OF EVEN NO.S ARE %d",sum_even);
printf("\nTHE TOTAL OF ODD NO.S ARE %d",sum_odd);
printf("\nTHE AVERAGE OF ALL EVEN NO.S IS %f",avg_e);
printf("\nTHE AVERAGE OF ALL ODD NO.S IS %f",avg_o);
getch();
OUTPUT :
ENTER THE NO 1 1 : 2
ENTER THE NO 1 2 : 6
ENTER THE NO 1 3 : 3
ENTER THE NO 2 1 : 4
ENTER THE NO 2 2 : 7
ENTER THE NO 2 3 : 8
ENTER THE NO 3 1 : 9
ENTER THE NO 3 2 : 1
ENTER THE NO 3 3 : 2
NO ARE IN ASCENDING ORDER
1 2 2
3 4 6
7 8 9
Programming an odds betting website Project Description: We want someone to program a odds betting website, Require someone with experience and skills! Skills required are
#questioA Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a str
pseudo code that will determine if the number is prime or composite
Implement (a part of) electronic election Scenario where following political parties are participating in election: PPP, PML and PTI. Create a class PollingStation where it stor
a padovan string p(n) for a natural number n is defined as p(0)=''x'' p(1)=''y'' p(2)=''z'' p(n)=p(n-2)+p(n-3),n>2
Explain Object-oriented programming Object-oriented programming (OOP) attempts to meet these requirements, providing methods for managing enormous complexity, achieving reuse o
A: N delete p is a two-step procedure: it calls the destructor, and then releases the memory. The code developed for delete p is functionally similar to this (supposing p is of typ
pebble merchant problem
write a program in c language to implement stacks in a single array
Determine the size of an interger data type without using sizeof() function? A: #include int main() { int *i ; int *j = i + 1; cout }
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