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

  • Home
  • SEARCH
  • 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 8510709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:46:44+00:00 2026-06-11T03:46:44+00:00

So I am trying to write a function that receives a float value, returns

  • 0

So I am trying to write a function that receives a float value, returns a float value, and is displayed in main with printf. I keep getting the same errors:
markup2.c:58: error: conflicting types for ‘GetPrice’
markup2.c:46: error: previous implicit declaration of ‘GetPrice’ was here

Where am I making the mistake? I’ve tried typecasting everything that touches GetPrice but still no luck. Can someone please explain what I am doing wrong?

    #include<stdio.h>

// define the constant MARKUP as float value 0.1
#define MARKUP 0.1

int main()
{
    // declare variables
    char proceed;
    float value;
    float markupValue;

    // display welcome message to user and inform them of markup rate
    printf("\nThank you for using Chad Hammond's markup calculator.\n");
    printf("The current markup rate is %.1f%c.\n",MARKUP*100,'%');

    // ask user if they want to perform a markup
    printf("Would you like to markup an item? y/n:\n");
    scanf("%c", &proceed);

    // if yes, proceed to next step
    if(proceed == 'y')
    {
        // prompt user for the price of item to be marked up
        printf("Please enter a wholesale value to markup: ");
        scanf("%f", &value);

        // display input back to user
        printf("The wholesale value you entered was: %c%.2f\n",'$', value);
        markupValue = (value*MARKUP);

        // display amount of increase
        printf("The dollar amount of this increase will be: %c%.2f\n",'$', markupValue);

        // display total price after increse
        printf("The price for this item after markup is: %c%.2f\n",'$', (float)GetPrice(value));
    }else
        // if user did not want to markup an item, belittle them with sarcasm
        printf("Well, if you didn't want to markup an item you should have just used a Ti-83 and left me alone!\n\n");
    // display exit message
    printf("Thank you for using HammondInstruments Markup Calculator, goodbye.\n");

    // return that program has completed
    return 0;
}

float GetPrice(float value)
{
    float output;
    value += value*MARKUP;
    output = value;
    return (float)output;
}
  • 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-11T03:46:46+00:00Added an answer on June 11, 2026 at 3:46 am

    You will need to either declare or define GetPrice before your main.

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

Sidebar

Related Questions

I am trying to write a function that takes two containers of the same
I am trying write a function that generates simulated data but if the simulated
I am trying to write a function that will allow me to browse for
I am trying to write a function that can take three parameters: an SqlDataReader,
I'm trying to write a function that will: If there is no region selected,
i am trying to write a function that will make DataRow[column] return nullable typed
I'm trying to write a function that will let me red-shift or blue-shift a
I am trying to write a function that includes a file named header.php in
I am trying to write a function that will filter a list of tuples
I am trying to write a function that will: Disable the submit button when

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.