0 votes
124 views
in C programming by (98.9k points)
edited
C Program to Check Odd or Even Numbers

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
#include <stdio.h>
#include <conio.h>
 
int main(){
    int number;
    printf("Enter a number \n");
    scanf("%d", &number);
    if(number%2 == 1){
        // Input number is odd
        printf("%d is Odd Number\n", number);
    } else {
        // Input number is even
        printf("%d is Even Number\n", number);
    }
    getch();
    return 0;
}

 

Related questions

0 votes
1 answer 176 views
asked Jun 11, 2022 in Python by Doubtly (98.9k points)
0 votes
1 answer 136 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 114 views
0 votes
1 answer 117 views
0 votes
0 answers 71 views
0 votes
1 answer 140 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

557 users

...