Write an algorithm to check whether the given positive number is odd or even in programiz app ( computer C) please fast
Answers
Answered by
1
Explanation:
// Find number is even or odd
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
printf("Enter Any Number : \n");
scanf("%d",&a);
printf("----------------------\n");
if(a%2==0)
{
printf("\nNumber is Even.");
}
else
{
printf("\nNumber is Odd.");
}
getch();
}
Answered by
1
Answer:
include <stdio.h>
int main() {
int num;
printf("Enter an integer: ");
scanf("%d", &num);
// true if num is perfectly divisible by 2
if(num % 2 == 0)
printf("%d is even.", num);
else
printf("%d is odd.", num);
return 0;
}
Explanation:
mark me as brainlist pls
Similar questions