A store has 264 cricket balls.write a c program to find Are there an even or odd number of balls?
Answers
Answered by
4
/*
* C Program to check a number is odd or even using modulus operator
*/
#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;
}
* C Program to check a number is odd or even using modulus operator
*/
#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;
}
Answered by
36
ANSWER
...........
/*
* C Program to check a number is odd or even using modulus operator
*/
#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;
}
...........
/*
* C Program to check a number is odd or even using modulus operator
*/
#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;
}
Similar questions