Gizmos

Description:

An online retailer sells two products: widgets and gizmos. Each widget weighs 75 grams and Each gizmo weighs 112 grams. Write a program that reads the number of widgets and the number of gizmos in an order from the user. Then your program should compute and display the total weight of the order. Test Case 1 Input (stdin) 28 22 Expected Output widgets=28 gizmo=22 Total weight=4.564 Test Case 2 Input (stdin) 54 23 Expected Output widgets=54 gizmo=23 Total weight=6.626

Program :

#include <stdio.h>

int main()

{

int a,b;

  float c;

  scanf("%d%d",&a,&b);

  printf("widgets=%d\n",a);

  printf("gizmo=%d\n",b);

  c=(a*0.075)+(b*0.112);

  printf("Total weight=%.3f",c);

return 0;

}