1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
marissa [1.9K]
3 years ago
10

Write an app that reads an integer, then determines and displays whether the integer is odd or even. [Hint: Use the remainder op

erator. An even number is a multiple of 2. Any multiple of 2 leaves a remainder of 0 when divided by 2.]
Computers and Technology
1 answer:
Sholpan [36]3 years ago
8 0

Answer:

#include <stdio.h>// header file

int main() // main function definition

{

   int number; // variable declaration

   scanf("%d",&number); // user input for number

   if(number%2==0) // check the number to even.

   printf("Number is a even number"); // print the message for true value

   else

   printf("Number is a odd number"); // print the message for false value.

   return 0; // return statement.

}

Output:

  • If the user inputs is 2 then the output is "Number is a even number".
  • If the user inputs is 3 then the output is "Number is a odd number".

Explanation:

  • The above program is to check the even and odd number.
  • The first line of the program is used to include the header file which helps to understand the functions used in the program.
  • Then there is the main function that starts the execution of the program.
  • Then there is a variable declaration of number which is declared as an integer which takes the integer value because the program needs the integer only.
  • Then the scanf function is used to take the inputs from the user.
  • Then the if condition check that the number is divisible by 2 or not.
  • If it is divisible print "even number" otherwise print "odd-number".
You might be interested in
The inflationary gap occurs when you obtain no increase in output, but only an increase in the Average Price Level from an incre
Katarina [22]
<span>B. Second phase of the Keynesian LRAS Curve.</span>
8 0
3 years ago
What is a conditional Statement that causes the program to change its course​
Deffense [45]

Answer:

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language, which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

Explanation:

3 0
2 years ago
Why are high-quality transformers wound with large diameter wire?
lesya692 [45]
So that they can lower the I2R losses
8 0
3 years ago
In how many sections is the Add Animation pane divided? What is the utility of each section?​
NikAS [45]
It’s 45 sections they divided
3 0
3 years ago
Read 2 more answers
Preliminaries
Ratling [72]

Answer:

okahsb

Explanation:

8 0
3 years ago
Other questions:
  • PLEASE HELP Which of the following is considered a modern method of communication?
    6·2 answers
  • A network technician has configured a point-to-point interface on a router. Once the fiber optic cables have been run, though, t
    12·1 answer
  • The _____ is the area in Microsoft Excel where you can perform file commands such as Save, Open, and Print
    15·1 answer
  • What is A/B Testing
    10·2 answers
  • Ryan is working on the layout of his web page. He needs to figure out where the title, links, text, and images should go. Which
    15·2 answers
  • 4.2: Roman Numeral Converter
    9·1 answer
  • Windows 1.0 was not considered to be a "true" operating system but rather an operating environment because _____.
    13·1 answer
  • The _____ feature will mark all changes made to a document for others to review at a later time.
    13·1 answer
  • What is the Cycle of Dependency?
    14·1 answer
  • This provides an easy method for workers to use their computers. FAT FAT RAM RAM DOS DOS GUI
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!