Output float: Result of the divide : Operator General « Language Basics « C / ANSI-C






Output float: Result of the divide

#include <stdio.h>

float result;  /* Result of the divide */

int main()
{
    result = 7.0 / 22.0;

    printf("The result is %f\n", result);
    return (0);
}

           
       








Related examples in the same category

1.compute the area of a triangle, given its width and height
2.This program produces a Celsius to Fahrenheit conversion chart for the numbers 0 to 100
3.Use and
4.Using the ;amp operator: get the addressUsing the ;amp operator: get the address
5.Calculations: plus
6.Calculations: plus and minusCalculations: plus and minus
7.Calculation: divide and mod, / %Calculation: divide and mod, / %
8.Division with float values and output it
9.Calculation: divide, product and PICalculation: divide, product and PI
10.Bitwise operatorBitwise operator
11.( ) operator
12.Plus operator
13.Operator for int value