In this article I would like to share the work of my student named Arjay Lucernas Vicente we ask permission to him if we can share his work in our website which he agrees to help also other programmers around the world. This program will ask the user to give three numbers and then the program will determine which of the three numbers given is the highest and smallest in terms of values using C++. I would like to thank Arjay for sharing his work to us.
I am currently accepting programming work, it project, school
programming projects , thesis and capstone projects, IT consulting
work, computer tutorials and web development work kindly contact me in the following email address for further details. If you want to advertise in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Program Listing
number.cpp
/* Arjay Lucernas Vicente */
/* July 23, 2018 */
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int a, b, c;
int smallest, largest;
cout << "Please enter 3 numbers: " ;
cout<<"ikauna nga numero ";
cin>> a;
cout<<"\n\n";
cout<<"ikaduwa nga numero ";
cin>> b;
cout<<"\n\n";
cout<<"ikatatlo numero ";
cin>> c;
cout<<"\n\n";
smallest = a;
largest = a;
if (b > largest)
largest = b;
if (c > largest)
largest = c;
if (b < smallest)
smallest = b;
if (c < smallest)
smallest = c;
cout << "largest: " << largest;
cout << "\n\n";
cout << "smallest: "<< smallest << endl;
cout <<"\n\n\n";
const int SIZE = 11;
for (int i = 0; i<SIZE; i++)
{
std::cout << (((1 + (i * 2)) < SIZE) ? std::string((SIZE / 2 - (1 + (i * 2)) / 2), ' ') : std::string((SIZE / 2 - (SIZE * 2 - (1 + (i * 2))) / 2), ' ')) << (((1 + (i * 2)) < SIZE) ? std::string((1 + (i * 2)), '*') : std::string(SIZE * 2 - (1 + (i * 2)), '*')) << endl;
}
printf("powered by: ARJAY VICENTE");
}
No comments:
Post a Comment