Dev C keeps returning a wrong value

1.4k Views Asked by At
#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.

1

There are 1 best solutions below

0
On BEST ANSWER

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