CS201 Assignment1 Complete Solution 6

No Comments

#include<iostream.h>
#include<stdlib.h>

  main()
 {float formula,y1,y2,x1,x2,Xcordinates,Ycordinates,slope,difference, difference1;
   
     cout<<"\a \t\t ASSIGNMENT POWERED BY S.SABIR HUSSAIN 6TH SEMESTER";
     cout<<"\n\n\n\n Enter the X-cordinates of starting point i.e x1=";
     cin>> x1;
     cout<<"\n Enter the X-cordinate of end point i.e x2=";
     cin>>x2;
      {difference=x2-x1;
     if (difference==0)
     cout<<"line is parallel at y-axis"<<difference;
                }
                       
     cout<<"\n Enter the Y-cordinates of starting point i.e y1=";
     cin>>y1;
     cout<<"\n Enter the Y-cordinate of end point i.e y2=";
     cin>>y2;
     { difference1=y2-y1;
    if (difference1==0)
     cout<<"line is parallel at x-axis"<<difference1;
               
     }
     slope=y2-y1/x2-x1;
    { if(slope>1)
           
                 cout<<"Line will make the 45 degree angle with the horizon"<<slope;

      if(slope<1)
           
                     
                 cout<<"Line will travel more along X-Axis and Less along Y-Axis="<<slope;
               
      if(slope==1)
           
                 cout<<"Line will make the 45 degree angle with the horizon"<<slope;
     
     
     
}
             
   
     system("pause");
     return 0;
   
     }
Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment