Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Why doesn't variable change values? C

$
0
0
Hi guys, I'm creating a small little program. I was wondering why my variables are staying at their initialized values instead of what the input is supposed to change it to. Originally I was scanning in the double wrong, but I"m pretty sure I'm doing it correctly, correct?


#include <stdio.h>

int main(){

double length = 0.0;

printf("Enter number: ");

scanf("%1f", &length);
printf("%f", length);

return 0;




Any help please?

Viewing all articles
Browse latest Browse all 51036

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>