Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

get float in c

//get a float from user
//print float value to console
#include <stdio.h>


int main()
{
    //define a float variable
    float a;
    
    //print the prompt
    printf("Please enter a float number: ");
    
    //Actually getting the number
    scanf("%f", &a);
    
    printf("You have entered %f", a);

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #float
ADD COMMENT
Topic
Name
4+7 =