Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

BSCS16025

LAB 1

PROB 1 PROB 2

Problems 4-7

//PROB 4
int A,B,C;
cout<<"enter A"<<endl;
cin>>A;
cout<<"enter B"<<endl;
cin>>B;
cout<<"enter C"<<endl;
cin>>C;
cout<<"Value of A\t"<<2*A<<"\t"<<2+A<<endl;
cout<<"Value of B\t"<<2*B<<"\t"<<2+B<<endl;
cout<<"Value of C\t"<<3*C<<"\t"<<3+C<<endl;
//PROB 5
cout<<" CCCC + +"<<endl;
cout<<" C + +"<<endl;
cout<<"C +++++++ +++++++"<<endl;
cout<<" C + +"<<endl;
cout<<" CCCC + +"<<endl;

//PROB 6
int num=0;
cout<<"enter any integer"<<num<<endl;
cin>>num;
int a=num%10000;
a=a/1000;

int b=num%1000;
b=b/100;

int c=num%100;
c=c/10;

int d=num%10;
int f=num/10000;
cout<<"Number in reverse order is"<<endl;
cout<<d<<c<<b<<a<<f<<endl;

//PROB 7
int rooms;
cout<<"Enter no. of rooms"<<endl;
cin>>rooms;
int cost_for_1room= 2000;
int cost;
cost=rooms*cost_for_1room;
cout<<"Cost for "<<rooms<<" "<<"rooms is "<<cost<<endl;

You might also like