27 lines
467 B
C
27 lines
467 B
C
|
#include <stdio.h>
|
||
|
#include "gm.h"
|
||
|
void main(void);
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
DEC da, *a=&da, db, *b=&db, dc, *c=&dc;
|
||
|
char str[30];
|
||
|
|
||
|
ZeroDecimal(a);
|
||
|
ZeroDecimal(b);
|
||
|
ZeroDecimal(c);
|
||
|
|
||
|
printf(" First number: ");
|
||
|
scanf("%s", str);
|
||
|
ConvAsciiToDecimal(a,str);
|
||
|
|
||
|
printf("Second number: ");
|
||
|
scanf("%s", str);
|
||
|
ConvAsciiToDecimal(b,str);
|
||
|
|
||
|
MultiplyDecimalAndRound(c, a, b, 2);
|
||
|
|
||
|
ConvDecimalToAscii(str,c);
|
||
|
printf("The product rounded to 2 decimal places is %s\n",str);
|
||
|
}
|