Simple While Cycles

0
#include <stdio.h>

main(){

    int cont=15;
    while(cont<=200){
        printf("%d\n",&cont);
        cont++;     
    }
}

Supposedly the counter should start with value 15 and go showing its value by adding 1 at the end of each cycle. But when I run the program it only shows 2293324 on all lines ... I already tried to add another variable to make the square and remains the same.

    
asked by anonymous 20.11.2016 / 13:33

1 answer

1

Remove% with% of this line & :

Code:

#include <stdio.h>

int main(void) {
    int cont=15;
    while(cont<=200){
        printf("%d\n",cont);
        cont++;     
    }
    return 0;
}

Example OnLine

    
20.11.2016 / 14:38