Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c float

// create float and assign value
// print float value to console
#include <stdio.h>

int main()
{
    float pi = 3.14;
    float dollars;
    dollars = 32.27;

    printf("I have %f dollars", dollars);       
  
	// controls the number of numbers shown after the decimal point
    printf("
I have %0.2f dollars", dollars); 
 
PREVIOUS NEXT
Tagged: #float
ADD COMMENT
Topic
Name
8+3 =