Computer Science, asked by Anonymous, 1 year ago

100 points for computer lovers ..{write a code in C to determine a number enter by the user is even or odd ? with steps .

Answers

Answered by MacTavish343
0
Hell.. ooo friend this program i made in DEVC++ point of view
because it doesn't include conio. h and void


#include <stdio.h>
int main()
{
int number;

printf("Enter an integer: ");
scanf("%d", &number);
if(number % 2 == 0)
printf("%d is even.", number);
else
printf("%d is odd.", number);

return 0;
}

MacTavish343: yep always post this type of questions!!
Anonymous: hmm ok bro
MacTavish343: ok
MacTavish343: which class bro??
Anonymous: doing engineering
Anonymous: from iit roorkee
MacTavish343: hahah
MacTavish343: wow!!
Anonymous: what's to laugh bro ??
MacTavish343: i think that you are kidding!!
Answered by Frost321
1
#include <stdio.h>
int main()
{
int number;

printf("Enter an integer: ");
scanf("%d", &number);

// True if the number is perfectly divisible by 2
if(number % 2 == 0)
printf("%d is even.", number);
else
printf("%d is odd.", number);

return 0;
}

Anonymous: tysm dude ^_^
Similar questions