/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
/* Programa Principal */
#include <stdio.h>
#include <string.h>
/* Principal função do Programa */
int main( void )
{
double cal_1;
double cal_2;
char cal_1_str[120];
char cal_2_str[120];
cal_1 = (1331108.20 * 10.70/100 - 22500.00) / 1331108.20;
cal_2 = ( 200000.00 * 7.3/100 - 5940.00) / 200000.00;
printf("%s \n","Antes de Stringalizar" );
printf( "%s %.7f \n","Valor em calculo ""1:",cal_1 );
printf( "%s %.7f \n","Valor em calculo ""2:",cal_2 );
printf( "\n\n" );
/* Stringalizando ... */
sprintf( cal_1_str,"%.7f",cal_1 );
sprintf( cal_2_str,"%.7f",cal_2 );
strchr( cal_1_str,'.' )[5] = '\0';
strchr( cal_2_str,'.' )[5] = '\0';
/* Stringalizado */
printf( "%s \n","Depois de Stringalizar" );
printf( "%s %s \n","Valor em calculo ""1:",cal_1_str );
printf( "%s %s \n","Valor em calculo ""2:",cal_2_str );
return 0x0;
}