CP Lab 1 Task 1-4
CP Lab 1 Task 1-4
Lab
Semester BS (CS) – 01
LAB 1 TASK 1
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string name;
int age;
float CGPA;
char section = 'B', grade;
cout << "Enter your name:";
cin >> name;
cout << "Enter your age:";
cin >> age;
cout << "Enter your grade:";
cin >> grade;
cout << "Enter your CGPA:";
cin >> CGPA;
cout << endl;
cout << "Student Record" << endl;
cout << "Your section is:" << section << endl;
cout << "Your age is:" << age << endl;
cout << "Your name is:" << name << endl;
cout << "Your grade is:" << grade << endl;
cout << "Enter your CGPA:" << CGPA << endl;
system("pause");
return 0;
}
TASK 2
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string name, age;
system("pause");
return 0;
}
TASK 3
#include <iostream>
using namespace std;
Department of Computer Sciences Semester BSCS1
CSL-113: Computer Programming Lab Journal
CSL-113: Computer Programming
Lab
Semester BS (CS) – 01
int main ()
{
int number;
TASK 4
#include <iostream>
using namespace std;
int main ()
Department of Computer Sciences Semester BSCS1
CSL-113: Computer Programming Lab Journal
CSL-113: Computer Programming
Lab
Semester BS (CS) – 01
{
int a;
cout << "Enter number:";
cin >> a;
if (a == 1 || a == 2 || a == 3)
{
cout << "Accepted " << endl;
}
else {
cout << "Not Accepted " << endl;
}
system("pause");
return 0;
}