Making communications land - Are they received and understood as intended? we...
Math assignment Program
1. Name Bilal Maqbool
Department CS&IT
Class SE-I (2011-15)
Roll # 10
Assignment C++ Programs
Submitted to Sir. Amir kamal
Abassi
Date 11/02/12
Day Monday
University University of Azad
Jammu & Kashmir
Subject Calculus and Analytical Geometry
2. Write down the procedure in C++ for plotting the data in a table.
#include <iostream.h>
#include <conio.h>
void line ()
{
for (int i = 1; i<=60; i++)
{
cout<<"_";
}
cout<< endl;
}
void main ()
{
int x,y;
int a[2][8];
for(x=0; x<2; x++)
{
for(y=0; y<8; y++)
{
cout << "Enter Elements in Row "<<(x+1)<<" "<<" Column "<<(y+1)<<" = ";
cin>> a[x][y];
}
cout<<endl;
}
line();
for(x=0; x<2; x++)
{
if(x==0)
{
cout<<" x ";
}
else
{
cout<<" y ";
}
for(y=0; y<8; y++)
{
cout <<"| "<< a[x][y] << "t";
}
cout<<endl;
}
line();
getch();
}
3. Output
Enter Elements of Row 1 Column 1 = 1
Enter Elements of Row 1 Column 2 = 2
Enter Elements of Row 1 Column 3 = 3
Enter Elements of Row 1 Column 4 = 4
Enter Elements of Row 1 Column 5 = 5
Enter Elements of Row 1 Column 6 = -1
Enter Elements of Row 1 Column 7 = -2
Enter Elements of Row 1 Column 8 = -3
Enter Elements of Row 2 Column 1 = 1
Enter Elements of Row 2 Column 2 = 4
Enter Elements of Row 2 Column 3 = 9
Enter Elements of Row 2 Column 4 = 16
Enter Elements of Row 2 Column 5 = 25
Enter Elements of Row 2 Column 6 = 1
Enter Elements of Row 2 Column 7 = 4
Enter Elements of Row 2 Column 8 = 9
__________________________________________
| x | 1 | 2 | 3 | 4 | 5 | -1 | -2 | -3 |
| y | 1 | 4 | 9 | 16 | 25 | 1 | 4 | 9 |
__________________________________________
4. Write down the C++ program for finding dy
/dx if y=x2
+2x+3