# Lab 2: Part_1

Run the following examples, see different variations of the output and show the output
--1---2-- Implement the following function in your code and see the effect

int GetAverage() { #include <iostream.h> int main() { int myAge = 22; cout << "My age is " << myAge << endl; return 0; }
--3--Implement the following code in your program and see the effect

store two floats float totalAverage = regularAverage + specialAverage; int truncatedAverage = (int) totalAverage; return truncatedAverage; }
-4--Implement the following code fragment in your program and see the effect float total, sum, cir, radius; pi = 3.141593; int kount; total = 0.0; kount = kount + 1; total = 2.0 * radius; sum = total; radius = cir / (2.0 * pi);

int a, b; const float pi = 3.14159; float circumference; radius = 6.0; a = 4; b = 3 + a; circumference = 2.0 * pi * radius; -5-- Implement the following code in your program and --6-see the effect

average = total_value / (number_of_entries = last - first);

#include <iostream.h> void main() { char character1 = 'A' , character2 ; cout << character1 << endl ; character2 = character1 + 1 ; cout << character2 << endl ; }

#include <iostream.h> #include <string.h> using namespace std; int main () { string mystring = "This is a string"; cout << mystring; return 0; }

#include <iostream.h> void main() { char character1 = '9' , character2 ; cout << character1 << endl ; character2 = character1 + 1 ; cout << character2 << endl ; cin.get() } #include <iostream.h> int main( ) { int num1, num2; cout<<"Enter the two numbers : "; cin>>num1>>num2; cout<<"\n The product is : "<<num1*num2; cout<<"\n The sum is : "<<num1+num2; cout<<"\n The difference is : "<<num1-num2; cout<<"\n The quotient is : "<<num1/num2; cout<<"\n The remainder is : "<<num1%num2; return 0; }

#include <iostream.h> int main () { int a=5; int b(2); int result; a = a + 3; result = a - b; cout << result; return 0; }