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

What contributed most to the coming of the American Revolution?
A shortage can be either short-term or long-term, but it is not an ongoing condition. True. False.
Tickets to a school dance cost $4 and the projected attendance is 300 people. For every $0.10 increase in ticket price, the dance committee projects that attend
Specialization makes each of the following possible EXCEPT: A. surplus of goods and services B. goods available in a short time frame C. variety of goods and se
what were the benefits of living along the Nile river?
what is the main purpose of scientific models
Vertebrates have a notochord during early embryonic development.
Find the equation of a line that passes through the point (12,9)and has a slope of 1/4
From your knowledge of Global Studies, how did the areas settled by the Greeks differ from the early settlements of the Fertile Crescent region, the Nile River
You are planning to make a collage and are gathering materials.for the backing you will use a piece of heavy recycled cardboard that is 4 3/4 feet longhand 2 2/