Hello everyone. I am trying to write a program that reads a percent discount and then deducts that from a total price. i was just wondering how do i assign percentages to a variable?

what i am doing is

print "please enter percent discount";
percent discount++

then be able to use that variable (which is a percentage) later on in the code. thanks

float discount = 0.25f;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.