Created
October 19, 2012 20:32
-
-
Save umutakturk/3920559 to your computer and use it in GitHub Desktop.
C++ Code Samples - Week 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
/* | |
int a, b; | |
a = 10; | |
b = 4; | |
a = b; | |
b = 7; | |
cout << "a:"; | |
cout << a; | |
cout << "b:"; | |
cout << b; | |
*/ | |
/* | |
int a, b, c, sum; | |
cout << "Please enter the first number" << endl; | |
cin >> a; | |
cout << "Please enter the second number" << endl; | |
cin >> b; | |
cout << "Please enter the third number" << endl; | |
cin >> c; | |
sum = a + b + c; | |
cout << "Sum of numbers = " << sum << endl; | |
*/ | |
/* | |
double es, lr, sr, area, perimeter; | |
cout << "Please enter edge of square" << endl; | |
cin >> es; | |
cout << "Please enter long length" << endl; | |
cin >> lr; | |
cout << "Please enter short length" << endl; | |
cin >> sr; | |
area = es * es; | |
perimeter = (lr + sr) * 2; | |
cout << "Area of square = " << area << endl; | |
cout << "Perimeter of rectangle = " << perimeter << endl; | |
*/ | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment