Jump to content

Why is this program not working properly?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
camdaddy09

camdaddy09

    Newbie

  • Members
  • PipPip
  • 15 posts
#include <stdio.h>


int main (void) {

   float 

	wholeNumber,

	fraction,

	percent;

	

	printf("\n\n What percent of: ");

	scanf("f", &wholeNumber);

	

	printf("\n is: ");

	scanf("f", &fraction);

	

	percent = (100 * fraction) / wholeNumber;

		printf("%f",percent);

    return 0;

}


Its been forever and a day since ive made a program so please forgive me :cursing:
[SIGPIC][/SIGPIC]

#2
camdaddy09

camdaddy09

    Newbie

  • Members
  • PipPip
  • 15 posts
i wasnt putting percent signs in front of the "f" float symbols :D
[SIGPIC][/SIGPIC]




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users