C - Write program to calculate on float type value

Requirements

Declare three float variables, and assign values to two of them.

Assign a value to the third variable by dividing the first variable by the second variable.

Display the result.

Demo

#include <stdio.h>

int main()//w  w  w .  j  a  v a2  s . c o  m
{
    float a,b,c;

    a = 15,5;
    b = 3.2;
    c = a / b;
    printf("Variable c=%f\n",c);
    return(0);
}

Result

Related Quiz