C - Write program to output calculation of 456.98 + 213.40 =

Requirements

Output looks like this:

456.98 + 213.40 = 670.38

Do not hard code 670.38.

Hint

Use placeholders instead of immediate values in the formatting string.

Demo

#include <stdio.h>

int main()/*  w w w  .j  a  v a  2  s  .co m*/
{
  printf("%.2f + %.2f = %.2f\n",456.98,213.4,456.98+213.4);
  return(0);
}

Result

Related Quiz