-1

unresolved external symbol _main referenced in function "int _cdecl invoke_main(void)" (?invoke_main@@yahxz)

////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{

    int qty, price, total_exp, discount = 10;

    printf("\nenter qty: ");
    scanf_s("%d", &qty);
    printf("Entered qty: %d\n", qty);

    printf("enter the price: \n");
    scanf_s("%d", &price);
    printf("Entered price: %d\n", price);

    if (qty > 1000) {
        total_exp = (qty * price * discount) / 100;
        printf("total_exp: %d\n", total_exp);
    }
    else {
        total_exp = qty * price;
        print("total_exp: %d\n", total_exp);
    }
    getch();
    return 0;
}
drescherjm
  • 10,365
  • 5
  • 44
  • 64
  • 1
    Does this answer your question? [Error LNK2019 unresolved external symbol \_main referenced in function "int \_\_cdecl invoke\_main(void)" (?invoke\_main@@YAHXZ)](https://stackoverflow.com/questions/33400777/error-lnk2019-unresolved-external-symbol-main-referenced-in-function-int-cde) – Karl Knechtel Oct 17 '22 at 01:40
  • Welcome to Stack Overflow. Please read [ask], and [please try](https://meta.stackoverflow.com/questions/261592/) to look for existing answers before posting, for example by [using a search engine](https://duckduckgo.com/?q=unresolved+external+symbol+_main+referenced+in+function+%22int+_cdecl+invoke_main(void)%22+(%3Finvoke_main%40%40yahxz)). – Karl Knechtel Oct 17 '22 at 01:41
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 17 '22 at 02:05
  • I have deleted the MS visual studio and reinstalled it all over again, that was one of solution provided by a community member. Issue is resolved and data was saved as well. – user20258934 Oct 19 '22 at 00:48

1 Answers1

0

If I change this line:

  print("total_exp: %d\n", total_exp);

To this one:

  printf("total_exp: %d\n", total_exp);

The program works for me.

Jino Michel Aque
  • 513
  • 1
  • 4
  • 16