0
#include <stdio.h>
#include <conio.h>
int main ()
{
  int numc;
  puts ("NUMBER PLEASE");
  numc=getchar();
  printf ("%d");
  getch ();
  return 0;
}

I get the warning numc is assigned a value that is never used, while I'm trying to get the value. Please help.

SirVirgin
  • 153
  • 1
  • 3
  • 10

2 Answers2

0

you never used numc value after assigning.. that's why it is giving warning..

Deven Singh
  • 398
  • 1
  • 3
  • 16
0

Did you mean:

printf ("%d", numc);

? That would use the value the the compiler is warning you about.

Sᴀᴍ Onᴇᴌᴀ
  • 8,218
  • 8
  • 36
  • 58
Andrew
  • 16