Write a c++ program to check a number is even or odd

Assignment Help C/C++ Programming
Reference no: EM13766427

Part 1

1. Determine whether the following conditions are True or False?

x = 4, y = 20, z = 3.

A) x < y+z, B) x-y>= 1,

C) x != y,

D) z >12 ,

E) !(x < 3)

F) z-6 <= 6

G) x<1 || y>5

H) z<1 && z >2.

Note: Solve this by hand and show the calculations.

2. Write a C++ program to check whether a number entered by user is even or odd.

Pseudo code:
Read the number n;
if (n is divisible by 2),
Print "n is even";
else
Print "n is odd";

3. Write a C++ program to relate two integers entered by user using == or > or < sign.

Pseudo code:
Read values of 2 numbers a ,b;
if (a is equal to b),
Print "a=b";
else if (a is less than b),
Print "a<b";
else if (a is greater than b),
Print "a>b";

Part 2

1. Write C++ statements for the following expressions,

1.1. Exp1 = a/b + c/d

1.2. Exp1 = am/bn

1.3. Exp1 = log(xr)

1.4. Exp1 = x2 +3x -10

1.5. Exp1 = {-b + √(b2-4ac)}/2a

2. Write a C++ program to convert degrees Kelvin to degrees Fahrenheit.

3. Write a C++ program to compute volume V of a sphere of radius r.

 

Reference no: EM13766427

Questions Cloud

Issues related to abortion : I believe that we need to educate ourselves better about genetically modified foods.
How the criminal were apprehended : What happened, How the criminal(s) were apprehended, What type of sentence was given, Any monetary restitution ordered, How this crime differs from a case that was merely theft and did not involve a computer
How did berlioz use the instruments of the orchestra : How did Berlioz use the instruments of the orchestra to represent the characters and scenery of the program? Begin with a brief introduction including important facts about Berlioz's life and career.
Similarities between theory and hypothesis : Is any one type of theory more valid than the others? Why or why not? What are the differences and similarities (if any) between theory and hypothesis
Write a c++ program to check a number is even or odd : Write a C++ program to check whether a number entered by user is even or odd.
Write a paper on play a midsummer night dream by shakespeare : Write a paper on play A Midsummer Night Dream by Shakespeare. Make an arguement of 900 to 1200 words for why we laugh "at" the "mechanicals" rather than "with" them.
Discuss what makes this an ethical dilemma : Discuss what makes this an ethical dilemma. 2) Discuss the implications of this study in terms of the moral principles described in chapter 1. Respect for persons: Did the hospital/ physicians allow the parents to be autonomous in their decision-m..
Issue related to liability protection : From the perspective of a Christian worldview, is it wrong for a business to try to minimize its overall tax burden?
Discuss the principle determinants of the cdcs decision : From a risk assessment perspective, discuss the principle determinants of the CDC's decision to recommend full-scale manufacture of, and immunization of the public with a vaccine specifically developed for a swine-flu virus

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd