Получи float c

Примерен код

4
0

c гаф

// 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); 
0
0

получи float 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);

}

Подобни страници

Подобни страници с примери

На други езици

Тази страница на други езици

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Íslensk
..................................................................................................................