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

  Cashregister class that can be used with the retailitem clas

Write a CashRegister class that can be used with the RetailItem class that you wrote in Part 1. The CashRegister class should simulate the sale of a retail item. It should have a constructor that accepts a RetailItem object as an argument.

  Supposed to swap numbers

The program is supposed to swap numbers, but I am stuck something is wrong! It does not swap them it repeats the second number, please help to fix! Thanks, this is in C++.

  C string and two int reference parameters

Write a complete function, not an entire program, that has a C string and two int reference parameters (call them a and b), returning nothing.

  Add a sentinel command to stop the loop

add a sentinel command to stop the loop. When the program is compiled, It'll ask the user to type in a palindrome. I want the user to type EXIT to end the loop.

  Write a program with a while loop to print 1 to n in square

Write a program with a while loop to print 1 to N in square brackets. N is an integer input from the user. (i) Write the same program using a for-loop

  Write a header for the function named subtract

Write a header for the function named subtract. Subtract returns nothing and has one double parameter named num.

  Compute the area of a pentagon

Evaluate the area of a pentagon given by the coordinates - Please make sure it compiles and write the full program to receive full credit. Thank you so much for your help.

  Write a c++ program that displays a table showing the price

write a C++ program that displays a table showing the price of silver and gold.

  Write a function named flattens

Write a function named flattens that takes a two-dimensional array of integers with 100 rows and 200 columns and returns a vector that contains all of the array's elements.

  Design is known, what advantages does keeping

Given that the design is known, what advantages does keeping the source code unavailable give the company and those who purchase the software? What disadvantages does it cause?

  Problem 1 write program to print the subsequent stars in

problem 1. write program to print the subsequent stars in the screennbspproblem 2. suppose your 1000 is earning

  Modify it so it gives the ith largest number

the follow code gives the ith smallest number, how do you modify it so it gives the ith largest 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