#Include #Include #Include Using Namespace Void Int For Int
#Include #Include #Include Using Namespace Void Int For Int
#include <conio.h>
#include <iomanip>
void main()
{
int age[4];
for(int i=0;i<4;i++)
{
cout<<"your the age: ";
cin>>age[i];
}
cout<<"Displaying Data: "<<endl;
for(int j=0; j<4; j++)
{
cout<<"your entered: "<<age[j]<<endl;
}
getch();
}
#include <iostream>
#include <conio.h>
#include <iomanip>
void main()
{
double sales[10];
int i;
double sum=0;
double average;
for(i=0;i<10;i++)
{
sum=sum+sales[i];
}
average=sum/10;
cout<<endl;
cout<<"The sum of sale is: "<<sum<<endl;
cout<<"The average sale is: "<<average<<endl;
getch();
}
#include <iostream>
#include <conio.h>
#include <iomanip>
void main()
{
char str[80]; //character array
cout<<"Enter character: "<<endl;
cin.get(str,80);
cout<<"You entered: "<<str<<endl;
getch();
}
#include <iostream>
#include <conio.h>
#include <iomanip>
#include <string>
using namespace std;
}
if (found)
return loc;
else
return -1;
}
void main()
{
int list[5];
int number,index;
for(index=0;index<5;index++)
{
cout<<"Enter an array of 5 integer: "<<endl;
cin>>list[index];
}
cout<<"Enter number to be Searched: "<<endl;
cin>>number;
cout<<endl;
int location;
location=seqSearch(list,5,number);
if(location!=-1)
cout<<"The Number is found at position: "<<location<<endl;
else
cout<<"The number is not found in the list: "<<endl;
getch();
}
LAB TASKS
Q1
#include <iostream>
#include <conio.h>
#include <iomanip>
void main()
{
int i , j ;
int product [10][10];
getch();
}
Q2:
#include <iostream>
#include <conio.h>
#include <iomanip>
void main()
{
int list[5];
int sum = 0 , average , large = 0;
}
cout<<large<<endl;
cout<<"Enter the sum "<<endl;
for (int i = 0 ; i < 5 ; i++)
{
sum = sum + list[i];
}
cout<<sum<<endl;
cout<<"average is "<<endl;
average = sum / 5;
cout<<average<<endl;