write a program to take a number as input then check whether it is an odd number or not
Answers
Answered by
1
C++
#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
if(n%2==0)
cout<<"not odd";
else
cout<<"odd";
return 0;
}
#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
if(n%2==0)
cout<<"not odd";
else
cout<<"odd";
return 0;
}
Answered by
0
C
#include <stdio.h>
void main()
{
int n;
scanf("%d", &n);
if (n % 2 != 0)
printf("/n%d is odd", n);
else
printf("/n%d is even", n);
}
#include <stdio.h>
void main()
{
int n;
scanf("%d", &n);
if (n % 2 != 0)
printf("/n%d is odd", n);
else
printf("/n%d is even", n);
}
Similar questions
Music,
7 months ago
Social Sciences,
7 months ago
Computer Science,
1 year ago
English,
1 year ago
Hindi,
1 year ago