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

  Throws an exception from a deeply nested

Write a program that throws an exception from a deeply nested function and still has the catch handler following the try block enclosing the initial call in main catch the exception

  Write a c program that reads n positive numbers from the

write a c program that reads n positive numbers from the keyboard calculates and displays the following information.a.

  Write the propositional function

Write the propositional function based on the subsequent proposition and create a proposition by using universal quantification and existential quantification

  Express the definition of the class rectangletype

The definition of the class rectangleType and the definitions of the operator functions are.

  Program that evaluates a infix expression

Program that evaluates a infix expression using stacks terminated by an equal sign. for example: (4-2)-5)/(2+1)-2))=the expression will contain single digit and the operators +, -, *,/. Make sure to consider the operator precedence.

  User to enter a positive integer with 2 digits

It asks the user to enter a positive integer with 2 digits - If the entered number is out of range, the message "Too difficult!" is printed and the program terminates.

  Write a program to calculate students average test scores

Write a program to calculate students average test scores

  Asignment1questionwrite a recursive function void reverse

assignment1questionwrite a recursive function void reverse that reverse a sentence.for examplesentence greeting new

  The westfield carpet company has asked you to write an

the westfield carpet company has asked you to write an application that calculates the price of carpeting for

  Collection of course components and weighting schemes

Define the data type that represents the collection of course components and weighting schemes and break down the required functionality into modular, reusable functions

  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.

  Need to convert this c code to mips

You need to convert this C code to MIPS - The subsequent is a sample output (user input is 2): Enter an integer: 2 The count of the integers that are greater than 2 is: 3 You have to assure the requirements specific in the instruction.

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