-5
#include <stdio.h> 
#include <stdlib.h> 
main() 
{
    int n; 
    printf("Introduce un número entero\n"); 

    scanf("%d", &n); 
    printf("Has introducido el número: %d", &n); 
} 

Every time I run this C code I get 6487628 for n, I have uninstalled and installed it over and over again and it keeps doing that, I don´t know what else to do.

Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123

1 Answers1

4

You don't want the &n in the printf(), you want n. You are displaying the memory location n is stored in

One Guy Hacking
  • 1,176
  • 11
  • 16