Write a program to determine a natural number

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

Program: Write a program to determine if a natural number has only 2 and/or 3 as prime factors and how many of each factor (2 and 3) it does have.

Write your program from scratch (you can reference other examples to get started with the basic structure of a program) and name it prime23.cpp. The program should meet the following requirements:

Part 1: Prompt (print a message to the user) to enter a natural number. [i.e. use cout]

Part 2: Receive the integer input from the user. [i.e. use cin ]

Part 3: Implement your algorithm (using while loops and if statements).

Part 4: Print either "Yes" and a count of 2 factors and a count of 3 factors (i.e. an input of 24 would print: Twos=3, Threes=1) or "No" if the number has neither a factor of 2 nor 3.

You have to satisfy the requirements specific in the instruction - It must compile with no errors and follow the directions.

Reference no: EM13694490

Questions Cloud

Protocol used to update the massive routing tables : What is the name of the protocol used to update the massive routing tables maintained on routers within the internet?
Object code for the subsequent program : Write down the object code for the subsequent program, assuming that it is not necessary to force extended addressing.
Write a literal representing the long integer : Write a literal representing the long integer value twelve billion.
Write a hexadecimal integer literal : Write a hexadecimal integer literal representing the value fifteen.
Write a program to determine a natural number : Write a program to determine if a natural number has only 2 and/or 3 as prime factors and how many of each factor (2 and 3) it does have.
Find the complement of f : Find the complement of F(A,B,C) = AB + ( BC' * A) and reduce it. Show your work for the reduction using the axioms of boolean algebra. then, implement the simplified expression using AND,OR and NOT gates
Calculate the total amount of a meal purchased : Design your own HTML form and corresponding PHP page to calculate the total amount of a meal purchased as a restaurant.
Single dsl router : if an office had two computers connected via Ethernet layer 2 switch,  sharing a single dsl router connected to the internet, which error detection scheme would be more suitable for this scenario?
Rationale for declaring an array of objects of the class : Explain the dimension of the array and why you chose that number of elements for the object array.Can you give the answer ASAP?

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