Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9198807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:22:30+00:00 2026-06-17T22:22:30+00:00

I have this code: #include<stdio.h> #include<conio.h> #include<math.h> float sinfa(num1, num2) { float fc; float

  • 0

I have this code:

#include<stdio.h>
#include<conio.h>
#include<math.h>

float sinfa(num1, num2)
{
    float fc;
    float powers;
    if(num1 == ""){
    powers = pow(num2,4);
    }else{
    powers = pow(num1,4);
    }
    fc = sin(num1-powers+1);
    return (fc);
}

float tp(fa,fb,num1,num2)
{
    float p;
    float fm2 = fa*num2;
    float fm1 = fb*num1;
    p = (fm2-fm1)/(fa-fb);
    printf("%f",fa);
    return (p);
}

float main()
{
double num1;
double num2;
float fa;
float fb;
float p1;

    clrscr();
    printf("Enter number 1: \n");
    scanf("%d", &num1);
    getch();
    printf("Enter number 2: \n");
    scanf("%d", &num2);
    getch();
    clrscr();
    fa = sinfa(num1);
    printf("%f \n",fa);
    getch();
    fb = sinfa(num2);
    printf("%f",fb);
    getch();
    clrscr();
    p1 = tp(fa,fb,num1,num2);
    printf("%f",p1);
    getch();

}

i kept getting 0 from the function tp, and the parameters does not enter when i sent them any ideas why? since for sinfa the parameters are sent and it returns a value

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:22:31+00:00Added an answer on June 17, 2026 at 10:22 pm

    You need to give types to the function parameters.

    float tp(float fa,float fb,int num1,int num2)
    

    Otherwise they are considered int and that leads to confusing effects.

    Similarly you should fix

    float sinfa(int num1, int num2)
    

    This wont cause a problem, but it is always good to be explicit about what you mean.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written this simple c code in microsoft visual c++ 2010. #include<stdio.h> #include<conio.h>
I have this code #include <stdio.h> #include <math.h> static double const x = 665857;
I'm very new to C and I have this code: #include <stdio.h> #include <math.h>
I have the following code for drawing a circle : #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h>
i have this code #include <math.h> #include <stdio.h> const int n = 3; const
I have this code: #include <stdio.h> #include <openssl/sha.h> #include <openssl/ssl.h> int main(){ printf(OpenSSL version:
I have this code which does the trick: #include <stdio.h> int main() { int
If I have a global static variable x like in this code #include <stdio.h>
I'm a beginner in C and I have code like this : #include <stdio.h>
This is an ANSI C question. I have the following code. #include <stdio.h> #include

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.