That's a good way of doing it. How to deal with default using only if statements?
Type: Posts; User: dev123
That's a good way of doing it. How to deal with default using only if statements?
Thanks all for your help. I am learning C on my own, still on the loop control chapters and I'm using Code Block with mingw as compiler.
I have added this line to deal with space and newline:
...
I have to replace the switch statement with a nested if/else of this program:
#include <stdio.h>
int main()
{
int grade;
int aCount = 0, bCount = 0, cCount = 0,
Thanks for your reply to both.
To Cogman:
Is there a way to round an integer value? For example, round the number 13456 to a four digits which will give 1346.
To New Ink
Henry, your logic is...
Code::Blocks with mingw. It has a GUI interface, use GNU GCC Compiler and free.
Code::Blocks
The exercise:
Modify the program in Fig. 4.6 so that it uses only integers to calculate the compound interest. (Hint: Treat all monetary amounts as integral numbers of pennies. Then "break" the...
Ok, thanks for the tip qwertylurker and dwks.
How can I get the first 5 digits in a random length integer?
For example: users input 1234567, 123456789, 1012345671
I should get 12345, 12345, 10123 respectively.
The number input by an user...