Skip to content

Instantly share code, notes, and snippets.

@djmunro
Created January 22, 2013 18:41
Show Gist options
  • Save djmunro/4597154 to your computer and use it in GitHub Desktop.
Save djmunro/4597154 to your computer and use it in GitHub Desktop.
2110 LAB1
#include <iostream>
#include <string>
using namespace std;
int main()
{
/*
//PART A
// A)
double var_1 = 20.25;
int x = 0;
int y;
x = y;
// B)
int z;
double var1;
double var2;
cout << "Hello\nBye" << endl;
cin >> x >> y >> z;
cin >> var1;
cin >> var2;
cout << var1 + var2;
// C)
char a;
char b;
char c;
cin >> a >> b >> c;
char str1;
char str2;
cout << "Enter First String" << endl;
cin >> str1;
cout << "Enter Second String" << endl;
cin >> str2;
cout << str1 << " " << str2 << endl;
return 0;
int x;
int y;
double total;
total = (x+1)/((y^3)-(x*y));
cin >> x;
cin >> y;
cout << total;
3 = 3 - (4*5)
5 = 5 + (8+5)
40 = 40 % (16/2)
88 = 88 / (82%4)
int ivar;
cout << "Enter a number: ";
cin >> ivar;
if (ivar == 0 || ivar == 1)
cout << "Do";
else
cout << "Exit";
#include<iostream>
using namespace std;
int main( )
{
double age, ticket = 12;
cout << "Please enter the age \n";
cin >> age;
if(age <= 8)
ticket = 6;
cout << "Your ticket costs " << ticket << endl;
return 0;
*/
int var_a;
int var_b;
int var_c;
int var_d;
int var_e;
int var_f;
int x = 1;
while (x ~= 4)
{
cin >> var_a;
cin >> var_b;
cin >> var_c;
cin >> var_d;
cin >> var_e;
cin >> var_f;
cout << var_a + var_b + var_c + var_d + var_e + var_f;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment