Webhosting in Pakistan
Results 1 to 5 of 5

Thread: need algorithm

  1. #1
    hasib ahmed's Avatar
    hasib ahmed is offline Advance Member
    Last Online
    19th October 2018 @ 10:32 AM
    Join Date
    08 Sep 2008
    Location
    rawalpindi
    Age
    29
    Gender
    Male
    Posts
    850
    Threads
    106
    Credits
    68
    Thanked
    15

    Red face need algorithm

    Webhosting in Pakistan

    algorithm about find the roots of quadratic equation
    yar koi bhi jaldi se agar bana do to meharbani ho gi i am wating
    ma ishq-e-kainaat ma zanjeer ho saku
    mujh ko hisar-e-zaat ke shar se rahai de


  2. #2
    Join Date
    07 Jan 2011
    Location
    Bruxelles
    Gender
    Male
    Posts
    19,835
    Threads
    1078
    Credits
    43,916
    Thanked
    3329

    Default



    bahi jaan yeh c k ley hai ..C_program_to_find_roots_of_quadratic_equation

    #include<stdio.h>
    #include<conio.h>
    #include<math.h>
    void main()
    {
    int a,b,c,d;
    float x1,x2,x,realp,imp;
    clrscr();
    printf("Enter the values of a,b & c:\n");
    scanf("%d %d %d",&a,&b,&c);
    d=b*b-4*a*c;
    if(d>0)
    {
    x1=-b+sqrt(d)/(2*a);
    x2=-b-sqrt(d)/(2*a);
    printf("\nThe Roots are real and not equal");
    printf("\nThe roots are........x1=%f x2=%f",x1,x2);
    }
    else if(d==0)
    {
    x=-b/(2*a);
    printf("\nThe roots are real and repeated");
    printf("\nHence the repeated root x is %f",x);
    }
    else
    {
    realp=sqrt(abs(d))/(2*a);
    imp=sqrt(abs(d))/(2*a);
    printf("\nThe roots are complex or imaginary ");
    printf("\n root1=%f+i%f",realp,imp);
    printf("\n root2=%f-i%f",realp,imp");
    }
    getch();
    }
    أستغفر الله وأتوب إليه

  3. #3
    kamibest's Avatar
    kamibest is offline Senior Member+
    Last Online
    21st January 2016 @ 09:21 PM
    Join Date
    20 Oct 2008
    Location
    karachi
    Age
    33
    Gender
    Male
    Posts
    1,320
    Threads
    134
    Credits
    726
    Thanked
    81

    Default

    YE WEBSITE VISIT KARE MAINE BOHAT PROBLEM SOLVE KARI HAI

    VISIT
    BestRegards
    lMicrosoft Certified IT Professional l System Engineerl Hardware,Virtualization,Wirelessl

  4. #4
    Join Date
    07 Jan 2011
    Location
    Bruxelles
    Gender
    Male
    Posts
    19,835
    Threads
    1078
    Credits
    43,916
    Thanked
    3329

    Default

    bahi yeh bhi dekh lein aap k kam aa jaye shayeed

    link


    link

    link

  5. #5
    hasib ahmed's Avatar
    hasib ahmed is offline Advance Member
    Last Online
    19th October 2018 @ 10:32 AM
    Join Date
    08 Sep 2008
    Location
    rawalpindi
    Age
    29
    Gender
    Male
    Posts
    850
    Threads
    106
    Credits
    68
    Thanked
    15

    Default

    Webhosting in Pakistan
    Quote derwaish said: View Post


    bahi jaan yeh c k ley hai ..C_program_to_find_roots_of_quadratic_equation

    #include<stdio.h>
    #include<conio.h>
    #include<math.h>
    void main()
    {
    int a,b,c,d;
    float x1,x2,x,realp,imp;
    clrscr();
    printf("Enter the values of a,b & c:\n");
    scanf("%d %d %d",&a,&b,&c);
    d=b*b-4*a*c;
    if(d>0)
    {
    x1=-b+sqrt(d)/(2*a);
    x2=-b-sqrt(d)/(2*a);
    printf("\nThe Roots are real and not equal");
    printf("\nThe roots are........x1=%f x2=%f",x1,x2);
    }
    else if(d==0)
    {
    x=-b/(2*a);
    printf("\nThe roots are real and repeated");
    printf("\nHence the repeated root x is %f",x);
    }
    else
    {
    realp=sqrt(abs(d))/(2*a);
    imp=sqrt(abs(d))/(2*a);
    printf("\nThe roots are complex or imaginary ");
    printf("\n root1=%f+i%f",realp,imp);
    printf("\n root2=%f-i%f",realp,imp");
    }
    getch();
    }
    thanx dear but ye to poora program bana dia aap ne just algorithm banana tha mera pehla smes hai or abhi just 2 classes hui hai iss ko samjhna mushkil hai mere lea bahi or pseducode ma or algorithm ma kitna farq hai

    Quote kamibest said: View Post
    YE WEBSITE VISIT KARE MAINE BOHAT PROBLEM SOLVE KARI HAI

    VISIT
    thanks for info
    Quote derwaish said: View Post
    bahi yeh bhi dekh lein aap k kam aa jaye shayeed

    link


    link

    link
    thanks again

Similar Threads

  1. Algorithm..>!
    By Faraz abbasii in forum Educational Help
    Replies: 1
    Last Post: 12th July 2013, 12:40 PM
  2. algorithm
    By hasib ahmed in forum Educational Help
    Replies: 1
    Last Post: 16th September 2011, 10:58 AM
  3. need algorithm
    By suraj goyal in forum Ask an Expert
    Replies: 3
    Last Post: 6th February 2011, 02:37 AM
  4. Need algorithm or source code....
    By suraj goyal in forum Ask an Expert
    Replies: 4
    Last Post: 18th December 2010, 08:04 AM
  5. Write an algorithm in pseudocode
    By swingtrader in forum Educational Help
    Replies: 4
    Last Post: 14th December 2010, 11:28 PM

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
  •