You are on page 1of 1

Maria Janina D. Malacas Nov.

24, 2016
2J-BSIE-CoEd

Problem 1: Enter your nickname. Problem 3: Find the sum, difference, product and
average of 3 numbers.
#include <cstdlib>
#include <cstdlib>
#include <iostream> #include <iostream>

using namespace std;


using namespace std;
int main(int argc, char *argv[])
{ int x, y, z, sum, diff, prod ;
int main(int argc, char *argv[]) float ave ;
{ string nickname ;
cout<< "Enter First Number : " ;
cin>>x ;
cout<< "Enter your nickname : " ; cout<< "Enter Second Number : " ;
cin>>y ;
cin>> nickname ;
cout<< "Enter Third Number : " ;
cout<< "Hello " <<nickname; cin>>z ;
cout<<endl; sum=x=y=z ;
cout<< "The Sum of Three Numbers is : "<< sum ;
system("PAUSE"); cout<<endl;
return EXIT_SUCCESS; diff=x-y-z;
cout<< "The Difference of Three Numbers is : "<<diff
} ;
cout<<endl;
Problem 2: Enter your fullname. prod=x*y*z;
cout<< "The Product of Three Numbers is : "<<prod ;
#include <cstdlib> cout<<endl;
#include <iostream> ave=sum/3.0;

cout<< "The Average of Three Numbers is : "<<ave ;


using namespace std; cout<<endl;

int main(int argc, char *argv[]) system("PAUSE");


{ string fullname ; return EXIT_SUCCESS;
}

cout<< "Enter your Fullname : " ;


getline (cin, fullname) ;
cout<< "HI! " <<fullname ;
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}

You might also like