trying to show the percentage sign but it keeps thinking i'm telling the program it as a command (well whatever it would be called lol)
if put the sign itself instead of writing it out, it wont even show itCode:#include <stdio.h> int main () { int c; float roa; float ni; float avg; { printf( "Welcome to Return on assets calculator\n" ); printf( "NOTE: DO NOT USE COMMAS! USE PERIOD TO PUT IN DECIMALS!\n" ); printf( "Enter the Net income\n" ); scanf("%f", &ni); printf( "Now enter the avarage total assets\n" ); scanf("%f", &avg); printf( "Your Retun on assets is\n" ); roa = ni/ avg; roa = roa* 100; printf("%f", roa); printf( "percent" ); while( (c=getchar()) != EOF && c != '\n' ){ } } getchar (); return 0;
oh and how do i remove decimals?
so instead of getting an answer like 15.77454564 it would show 15.77



LinkBack URL
About LinkBacks


