changsky changsky
  • 19-02-2022
  • Computers and Technology
contestada

how to write a code that determines if a number is odd or even?
the code should start with a variable declaration

Respuesta :

bushrahossain
bushrahossain bushrahossain
  • 19-02-2022

Answer:

//code in c++

#include <iostream>

using  namespace std;

int main() {

   int a;

   cin>>a;

   if(a%2==0){

       cout<<"Even number";

   }

   else{

       cout<<"Odd number";

   }

return 0;

Explanation:

Answer Link

Otras preguntas

Write an equation that represents the problem, then solve the problem. Seven-fourths decreased by a number is 2. Find the number
What percent of the suns energy reaches the earth?
Ben is 140cm tall. Mike is 1090mm tall. who is taller? How much taller?
ENIAC was the first instance of what? maglev trains GPS devices robotics electronic computers
Find the slope of the line 2x-10y=20
What is 132^2 as a product of its prime factors? With method Pleasee
HELP PLEASE Which are functions of lipids? Choose all answers that are correct. A. to assist with structural support B. to deliver amino acids C. to store en
Complete. Express the product in simplest form. 2/5 of 7/10 =
please help me solve 3/5x = 6/7
4. Which verb is in the present progressive form? A. had been driving B. am swimming C. will be flying D. was hopping 5. Which verb is in the present perfe