/* Check a number is even or odd */
#include<stdio.h>
int main()
{
int a;
printf("Enter a number: ");
scanf("%d",&a);
if(a%2==0)
printf("Even Number");
else
printf("Odd Number");
return 0;
}
#include<stdio.h>
int main()
{
int a;
printf("Enter a number: ");
scanf("%d",&a);
if(a%2==0)
printf("Even Number");
else
printf("Odd Number");
return 0;
}
Input a number until the user presses 0, and check whether the entered number is divisible by 3 or 5. Also count the total numbers divisible by 3 0r 5 and then separately display each calculated information
ReplyDeleteelse
Deleteprintf("not valide");
/* Check a number is even or odd */
ReplyDelete#include
int main()
{
int a;
printf("Enter a number: ");
scanf("%d",&a);
if(a%2!=0)
printf("Odd Number");
else
printf("Even Number");
return 0;
}
write a program for odd or even without using modulo operator?
ReplyDeletenice article for beginners.thank you.
ReplyDeletewelookups C++
javacodegeeks
nice article for beginners thanks you
ReplyDeletealso check this program
https://whitecoader.blogspot.com/2020/03/even-or-odd-numbers-in-c.html
DeleteNice article . you can use & operator for checking even or odd any number reference check even or odd without modulo
ReplyDeletevery helpful for me
ReplyDeleteIf the given number is odd or even
ReplyDeleteIn C++ language;
#include
using namespace std;
int main (){
int n;
cin >> n;
if (n%2 == 0){
cout << "Even number" << endl;
}
else {
cout << "Odd number" << endl;
}
}
Superb
ReplyDelete