Saturday, June 13, 2020

Odd and Even Numbers Checker in C Language

I wrote this program to ask the user to give a number and then the program will check and determine whether the given number is an odd or even numbers using C programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.comMy programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing

/*odd_even.c
 Author   : Jake Rodriguez Pomperada
 Work     : Freelance Software Engineer and Software Engineering Consultant
 Address  : #45-31 Victoria Malaga St. Eroreco Subd. Bry. Mandalanga, Bacolod City
            Negros Occidental, Philippines
 Email    : jakerpomperada@gmail.com
 Website  : www.jakerpomperada.com and www.jakerpomperada.blogspot.com
 Tool     : Dev C++ Version 5.11
 Date     : June 13, 2020   7:06 AM   Saturday
*/
#include <stdio.h>
int a=0,r=0,data=0,b=0;
int values[10];
void get_data();
void display_even();
void display_odd();

void get_data(void)
{
    printf("\n\n");
    printf("\tODD and Even Numbers Checker");
printf("\n\n"); 
    printf("\tHow Many Items To Be Process? :  ");
    scanf("%d",&data);
    printf("\n"); 
       for (b=1; b <= data; b++)
            {
            printf("\tEnter Item No. %d : ",b);
            scanf("%d",&b[values]);
            }
}

void display_even(void)
{
    printf("\n\n");
    printf("\tList of Even Numbers : ");
    printf("\n\n");
        for (a=1; a<=data; a++) {
            r = a[values] % 2;
            if (r ==0) {
            printf("\t %d ",a[values]);
         }
     }
}

void display_odd(void)
 {
    printf("\n\n");
    printf("\tList of Odd Numbers : ");
    printf("\n\n");
     for (a=1; a<=data; a++) {
         r = a[values] % 2;
         if (r!=0) {
          printf("\t %d ",a[values]);
         }
     }
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");
 }
 
int main() {
     get_data();
     display_even();
     display_odd();
 }

No comments:

Post a Comment