Professional Documents
Culture Documents
EXPERIMENT NO 1
Objective: The main objective of this lab is to understand about the DevC++ software.
And also know about the different data types in DevC++.
LAB ASSESSMENT:
Data presentation
Experimental results
Conclusion
Date: Signature:
BCE-IA Introduction to Programming
Lab Report: 2
Introduction to Programming
Submitted By,
Junaid Waqas
Roll Number
210781
Submitted To:
Engr. Mariam Sabir
2
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
Perform any arithmetic operation in DevC++.
CODE:
#include<iostream>
using namespace std;
int main ()
{
float a=3.5;
float b=4.6;
float c;
c=a+b;
cout<<a<<"+"<<b<<"="<<c<<endl;
return 0;
}
OUTPUT:
4
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
CODE:
#include<iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
cout<<"Enter 1st number:";
cin>>a;
cout<<"Enter 2nd number:";
cin>>b;
c=a/b;
cout<<a<<"/"<<b<<"="<<c;
}
OUTPUT:
5
BCE-IA Introduction to Programming
LAB TASK:
Write a Program using DEVC++ (Software) and also understand the basic
Operations.
Write header files at the top of Program.
Write the program by using extraction operators with terminators at the Last
while keeping in view the other symbol.
CODE:
#include<iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
cout<<"Enter 1st number:";
cin>>a;
cout<<"Enter 2nd number:";
cin>>b;
c=a+b;
cout<<a<<"+"<<b<<"="<<c;
}
OUTPUT:
6
BCE-IA Introduction to Programming
CODE:
#include<iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
cout<<"Enter 1st number:";
cin>>a;
cout<<"Enter 2nd number:";
cin>>b;
c=a-b;
cout<<a<<"-"<<b<<"="<<c;
}
OUTPUT:
7
BCE-IA Introduction to Programming
CODE:
#include<iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
cout<<"Enter 1st number:";
cin>>a;
cout<<"Enter 2nd number:";
cin>>b;
c=a*b;
cout<<a<<"*"<<b<<"="<<c;
}
OUTPUT:
8
BCE-IA Introduction to Programming
CONCLUSIONS:
After performing this lab, we are able to Perform any Arithmetic
++
operation in DevC without giving an input and also by giving an Input. We are able to
understand the different Data Types used in the DevC++.