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
damaskus [11]
2 years ago
7

Write a program to input a number and check whether it is even or odd number

Computers and Technology
1 answer:
Mashutka [201]2 years ago
3 0

Answer:#include <stdio.h>

int main() {

   int num;

   printf("Enter an integer: ");

   scanf("%d", &num);

   // true if num is perfectly divisible by 2

   if(num % 2 == 0)

       printf("%d is even.", num);

   else

       printf("%d is odd.", num);

   

   return 0;

}

You might be interested in
Define a function calc_pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a
Sever21 [200]

The missing segment of the code illustrates the use of functions.

Functions are also referred to as <em>procedures or methods</em>; they are set of instructions that act as one.

The code segment that complete the code in the question is as follows:

<em>def calc_pyramid_volume(length, width, height): </em>

<em>    baseArea = length * width </em>

<em>    Volume = baseArea * height * 1/3 </em>

<em>    return Volume</em>

<em />

<em />

The first line of the code segment declares the function itself

<em>def calc_pyramid_volume(length, width, height):</em>

Then, the base area of the pyramid is calculated

<em>    baseArea = length * width</em>

Then, the volume of the pyramid is calculated

<em>    Volume = baseArea * height * 1/3</em>

Lastly, the volume is returned to the main method

<em>    return Volume</em>

So, the complete code (without comments) is:

<em>def calc_pyramid_volume(length, width, height): </em>

<em>    baseArea = length * width </em>

<em>    Volume = baseArea * height * 1/3 </em>

<em>    return Volume </em>

<em>     </em>

<em>length = float(input()) </em>

<em>width = float(input()) </em>

<em>height = float(input()) </em>

<em>print('Volume for', length, width, height, "is:", calc_pyramid_volume(length, width, height))</em>

<em />

See attachment for the sample run

Read more about functions at:

brainly.com/question/17225124

8 0
2 years ago
How bridges are built over water
Black_prince [1.1K]
It’s all depending on what method
4 0
1 year ago
Synthesizing information can be done by creating
Maurinko [17]

Answer:

D

Explanation:

because you use all of those

4 0
3 years ago
Read 2 more answers
A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The n
MakcuM [25]

A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The new cabling was installed in the ceiling close to fluorescent lights and electrical equipment

Two factors may interfere with the copper cabling and result in signal distortion and data corruption are :

EMI

RFI

Explanation:

  • EMI (electromagnetic interference) is the disruption of operation of an electronic device when it is in the vicinity of an electromagnetic field (EM field) in the radio frequency (RF) spectrum that is caused by another electronic device.
  • During EMC testing, radiated emissions measurements are made using a spectrum analyzer and or an EMI receiver and a suitable measuring antenna.
  • EMI (Electromagnetic Interference) is also called RFI (Radio Frequency Interference).
  • Conducted RFI is unwanted high frequencies that ride on the AC wave form. Radiated RFI is emitted through the air. There are many pieces of equipment that can generate RFI, variable frequency drives included.
  • The internal circuits of personal computers generate EM fields in the RF range.
3 0
3 years ago
The best way to share criticism is to ______. a. write it in the break room b. talk it about with all your coworkers c. talk abo
ICE Princess25 [194]

Answer:

C.

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which object waits for and responds toan event from a GUI component?
    9·1 answer
  • An organization is building a new customer services team, and the manager needs to keep the tream focused on customer issues and
    13·1 answer
  • How can I code this in Python with only if-statements? (Only allowed to use the built-in functions int(), float(), and str().)
    8·1 answer
  • To complete this quest, answer the following questions in the submission box below. Make x an array going from 0 to 100 by steps
    15·1 answer
  • What is first page of website called​
    10·1 answer
  • Picking up sound over a great distance while making it seem to come from close up.
    11·1 answer
  • Which key combination should you use
    9·2 answers
  • Suppose you are working as an administrative assistant at a small law firm. Your boss has asked you to send an invitation out to
    5·1 answer
  • Is there a way for me to play a .mp3 file from my computer using Atom?
    10·1 answer
  • In cell b12 create a formula using max f7nction to calculate maximum value in B4:B9
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!