Answers for "int, float, char on c"

C
4

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("\nI have %0.2f dollars", dollars);
Posted by: Guest on April-09-2022
1

print float number completely in C language

printf("%.6f", myFloat);
Posted by: Guest on November-24-2020

Code answers related to "C"

Browse Popular Code Answers by Language