logo

ROBOTICS C++. 1. Robotics C++ Name of Student Instituti

5 Pages482 Words24 Views
   

Added on  2022-12-22

ROBOTICS C++. 1. Robotics C++ Name of Student Instituti

   Added on 2022-12-22

ShareRelated Documents
Running head: ROBOTICS C++ 1
Robotics C++
Name of Student
Institution Affiliation
ROBOTICS C++. 1. Robotics C++ Name of Student Instituti_1
ROBOTICS C++ 2
Part 1
#include <iostream> // Library for input/output
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input
loop */
int main( ) {
int input, remainder; // Declare two interger number
cout<<"Please enter a whole number:"; // Output prompt
cin>>input;
remainder=input%2; //Use modulus function
cout<<"The remander is: "<<endl;
//Do two things based on the integer being
//if/else statement
int i; //create a new loop control variable
if(remainder=0)//if an input is an even number (Check remainder)
{
i=input; //assign the loop control variable to input
while(i>=0) //Loop while i is greater than zero
{
cout<<i<<""; // Output the value of i
ROBOTICS C++. 1. Robotics C++ Name of Student Instituti_2

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Organizing Input Output in a Programming Language
|11
|3656
|107

new features of this C++ programming
|12
|1032
|16

OOPS Concepts: C++
|10
|1216
|314

C++ programming questions on recursion, loops, classes, and data structures
|6
|1265
|171

Assignment On Basic Mathematical Operations
|5
|460
|16

Error Checking And Handling
|12
|2453
|21