Write a program to check whether a number is even or odd

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

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";

Reference no: EM13760163

Questions Cloud

Define organizational structure : The actual question: use coca cola company, suggest what you believe to be the structure of it in terms of the six key elements that are used to define organizational structure.
Human a&p rearch paper : The paper must include a thorough description of the disease/condition; current statistics of those affected; explanations on how the various body systems are affected.
What are the shortcomings and limitations : Assume you have decided to implement DFS so remote sites can access files and folders. What are the requirements for DFS? What are benefits of using DFS? What are the shortcomings and limitations?
Develop a first-cut sequence diagram : Develop a first-cut sequence diagram, which only includes the actor and problem domain classes. Add the view layer classes and the data access classes to your diagram from part a. Develop a design class diagram based on the domain class diagram and..
Write a program to check whether a number is even or odd : Write a C++ program to check whether a number entered by user is even or odd.
Compare and contrast the verification and validation : The Question: Compare and contrast the Verification and Validation SQA processes.Accept criteria: No plagiarism, between 400 - 500 words. Eloquently written.
A video codec has to digitize an analog video signal : A video codec has to digitize an analog video signal that is band-limited to 5 MHz. If each sample of the video signal has to be encoded into one of 512 possible levels, and no compression techniques are used, the codec will generate a video bit rate..
Write essay on play death of a salesman arthur miller : Develop a 5-6 page reserach essay on the play story Death of a Salesman Arthur Miller. How does the portrayal of Willy Loman's life indirectly and directly affect the expectations of his sons, Happy and Biff?
The end-to-end communication : If a frame passes from a station through two switches, then through a router, then through two more switches, and then to the destination station, how many Ethernet frames will there be in the end-to-end communication?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to determine how long (sec.)

Using the v 2  form of drag, write a program to determine how long (sec.) and how far (m) a 150 gram ball whose radius is 3.5cm would fall before it reached 75% of its terminal velocity. Assume ball falls in air whose density is 1.21 kg/m 3 , has a d..

  A linked list of your song structure in cd

The CD object should have a data member that is a linked list of your song structure that you have in CD.  The CD class needs a function that allows it to add a song to the object, that function would then append the song to that instance of the link..

  Computer graphicsdevelop a simple interactive

computer graphicsdevelop a simple interactive two-dimensional spaceship deck plan editor using opengl and glut. your

  Print the matrix in a format and transpose of the matrix

Write a program which asks the user for 9 integers representing the elements of a 3 by 3 matrix by rows, stores the numbers in a 2-dimensional C++ vector, prints the matrix in a pretty format, prints the transpose of the matrix in a pretty format,..

  Calculate the component voltages

Calculate the component voltages for the following series resonant RLC circuit

  Exponent and significant of a floating point

Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum, subtraction or multiplication.

  The function should accept the future value

The function should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the function in a program that lets the user expe..

  Written a code that parses through a file reading

written a code that parses through a file reading it line by line and splitting it into tokens by white space. But I want a pair of single quotes to be one token, not how many words are in it

  Powers of a user specified range of integer numbers

Write a C program to print a table of the powers of a user specified range of integer numbers. The program should also print the sum of the powers of the numbers.

  What is an abstract base class

What is a pure virtual function. Why would you define a pure virtual function. Give an example of a pure virtual function. What is an abstract base class. What does it do. Why would you make a class abstract

  C programs hat print out the max, min, and the average value

Write three C programs that print out the max, min, and the average values of the data file included below. Be sure to include the outputs of the programs in your solutions. Use three data file structures (counter, sentinel, and neither counter/senti..

  Credit card is mastercard or visa card

Write  a C++ program  that  reads  the  card  type  and  the  card  number  and  then determine  if  the  card number entered is a valid card number

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