Webhosting in Pakistan
Results 1 to 3 of 3

Thread: Mujhe C++ ki help chahiye...

  1. #1
    MFaisal khan is offline Senior Member+
    Last Online
    27th February 2015 @ 11:47 AM
    Join Date
    13 Jun 2011
    Location
    Peshawar
    Age
    26
    Gender
    Male
    Posts
    138
    Threads
    32
    Credits
    0
    Thanked
    3

    Question Mujhe C++ ki help chahiye...

    Webhosting in Pakistan
    Assalam o alaikum experts... mujhe C++ ki help chahiye.. pehle to visual studios 10 ultimate full chahiye jo k meri university mai use ho raha hai.. second mje koi ye btaay k mai vs mai quadratic equation ko solve kese krun??? -b(sq) +- Sqrt b(sq) - 4ac / 2a
    ye meri assignment hai mene simple calculator to bna lia hai lakin ye mujhe samjh nhi arahi to plzz koi help krde..

  2. #2
    szacpp is offline Junior Member
    Last Online
    15th November 2017 @ 04:35 PM
    Join Date
    04 Nov 2009
    Age
    32
    Posts
    5
    Threads
    0
    Credits
    511
    Thanked
    0

    Default

    VS ki DVD khareed lo ya university may kisi dost say b li jasakti hay.

    Quadratic Equation C++ ka code ye hay.

    int a,b,c,discriminant;
    float r1,r2;
    cout<<"enter the values of a,b,c";
    cin>>a>>b>>c;
    discriminant=((b*b)-4*a*c);
    if(discriminant>0)
    {
    r1=(-1*b+sqrt(discriminant))/(2*a);
    r2=(-1*b-sqrt(discriminant))/(2*a);
    }
    else if(discriminant==0)
    {
    r1=r2=(-1*b)/(2*a);
    }
    else
    {
    discriminant=-1*discriminant;
    cout<<"r1="<<"("<<(-1*b)<<"+ i"<<sqrt(discriminant)<<")/"<<2*a;
    cout<<"r1="<<"("<<(-1*b)<<"+ i"<<sqrt(discriminant)<<")/"<<2*a;
    exit(0);
    }
    cout<<"r1="<<r1<<"\n";
    cout<<"r2="<<r2<<"\n";
    return 0;

  3. #3
    MFaisal khan is offline Senior Member+
    Last Online
    27th February 2015 @ 11:47 AM
    Join Date
    13 Jun 2011
    Location
    Peshawar
    Age
    26
    Gender
    Male
    Posts
    138
    Threads
    32
    Credits
    0
    Thanked
    3

    Exclamation

    Webhosting in Pakistan
    Quote szacpp said: View Post
    VS ki DVD khareed lo ya university may kisi dost say b li jasakti hay.

    Quadratic Equation C++ ka code ye hay.

    int a,b,c,discriminant;
    float r1,r2;
    cout<<"enter the values of a,b,c";
    cin>>a>>b>>c;
    discriminant=((b*b)-4*a*c);
    if(discriminant>0)
    {
    r1=(-1*b+sqrt(discriminant))/(2*a);
    r2=(-1*b-sqrt(discriminant))/(2*a);
    }
    else if(discriminant==0)
    {
    r1=r2=(-1*b)/(2*a);
    }
    else
    {
    discriminant=-1*discriminant;
    cout<<"r1="<<"("<<(-1*b)<<"+ i"<<sqrt(discriminant)<<")/"<<2*a;
    cout<<"r1="<<"("<<(-1*b)<<"+ i"<<sqrt(discriminant)<<")/"<<2*a;
    exit(0);
    }
    cout<<"r1="<<r1<<"\n";
    cout<<"r2="<<r2<<"\n";
    return 0;
    yar ap boht advanced kr rhay ho.. hmain filhal cout, cin, int, float, else, if else parhaya gaya hai.. boht basics coz 1st semester hai.. isliye us tareeqay se batain...

Similar Threads

  1. Mujhe help chahiye.
    By mohsinali2 in forum Mobile phones problems and Help Zone
    Replies: 2
    Last Post: 29th December 2014, 08:09 AM
  2. Mujhe Ye Chahiye
    By Kamran Saleem in forum General Discussion
    Replies: 7
    Last Post: 8th March 2010, 04:32 PM
  3. Mujhe Help Chahiye
    By interesting in forum Ask an Expert
    Replies: 10
    Last Post: 11th February 2010, 05:09 PM
  4. mujhe help chahiye urgent hai
    By master_mind630 in forum Mobile phones problems and Help Zone
    Replies: 0
    Last Post: 26th December 2009, 04:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •