* Program will find total number of odd numbers and total number of even numbers from array.
//Written by Latest Technology Guide
//Title : C Language Example # 31 Find out odd and even numbers from Array
#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int a[10]={0},i,sum=0,od=0,ev=0;
printf("\n Now Enter Value for Array A : \n");
for(i=0;i<10;i++)
{
printf("a[%d] = ",i);
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
if(a[i]%2==1)
od=od+1;
}
printf("\n\n\t\t : Odd Number is : %d",od);
for(i=0;i<10;i++)
{
if(a[i]%2==0)
ev=ev+1;
}
printf("\n\n\t\t : Even Number is : %d",ev);
getch();
}
Output:
* Program will display total number of odd numbers and total number of even numbers.
--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 31 Find out odd and even numbers from Array
* Program will create static array.
* Program will scan value from users and will store into array.
* Program will find total number of odd numbers.
Explanation of C Programming Language Example # 31 Find out odd and even numbers from Array
* Program will create static array.
* Program will scan value from users and will store into array.
* Program will find total number of odd numbers.
* Program will find total number of even numbers.
Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements.
C++ Program Even and Odd Elements in Array
ReplyDeleteoh, good
Visit nice example Even odd logic
ReplyDeletethank you for sharing nice article in your blog
ReplyDeletevisit
web tutorial programming
https://www.welookups.com
Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
ReplyDeleteSelenium training in Chennai
Selenium training in Bangalore
After reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
ReplyDeleteThank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in
Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
ReplyDeletenice article for beginners.thank you
java tutorial
Really you have done great job,There are may person searching about that now they will find enough resources by your post
ReplyDeletehardware and networking training in chennai
hardware and networking training in annanagar
xamarin training in chennai
xamarin training in annanagar
ios training in chennai
ios training in annanagar
iot training in chennai
iot training in annanagar
Thanks for your informative article,Your post helped me to understand the future and career prospects & Keep on updating your blog with such awesome article.
ReplyDeletehadoop training in chennai
hadoop training in porur
salesforce training in chennai
salesforce training in porur
c and c plus plus course in chennai
c and c plus plus course in porur
machine learning training in chennai
machine learning training in porur