Results 1 to 3 of 3

Thread: Compute quadratic equation using function

  1. #1
    Geek_Guest
    Guest

    Compute quadratic equation using function

    Question asked by luwam tewolde

    1.Write a c++ program that computes quadratic equation using function?
    2.Write a program that computes the product the product of a 3*3 matrix equation. (hint use multidimension array) ?
    I need answer for is question as soon as .


  2. #2
    Junior Member
    Join Date
    Oct 2006
    Answers
    5

    Re: Compute quadratic equation using function

    Use macros......

    #define F(x) x^2+7*x-10

    then write ur simple program using F(x)


  3. #3
    Expert Member
    Join Date
    Mar 2012
    Answers
    208

    Re: Compute quadratic equation using function

    Program for computing product of 3*3 matrix

    Code:
    void main()
    {
    int a[3][3],b[3][3],c[3][3],i,j,k;
    clrscr();
    
    printf("Enter elements of A:");
    for(i=0;i<=2;i++)
    for(j=0;j<=2;j++)
    scanf("%d",&a[i][j]);
    
    printf("Enter elements of B:");
    for(i=0;i<=2;i++)
    for(j=0;j<=2;j++)
    scanf("%d",&b[i][j]);
    
    printf("A:");
    for(i=0;i<=2;i++)
    {
    for(j=0;j<=2;j++)
    printf("%d ",a[i][j]);
    printf(""); //To change line.
    }
    
    printf("B:");
    for(i=0;i<=2;i++)
    {
    for(j=0;j<=2;j++)
    printf("%d ",b[i][j]);
    printf("
    ");
    }
    k=0;
    while(k<=2)
    {
    for(i=0;i<=2;i++)
    {
    int sum=0;
    for(j=0;j<=2;j++)
    sum=sum+a[i][j]*b[j][k];
    c[i][k]=sum;
    }
    k++;
    }
    printf("Result:");
    for(i=0;i<=2;i++)
    {
    for(j=0;j<=2;j++)
    printf("%d ",c[i][j]);
    printf(" ");
    }
    getch();
    }


    Last edited by admin; 07-09-2012 at 06:32 AM.

  4.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact