I don't understand what you mean by "Set your precision to 0, a la %.0f." Could you post an example using my code so that I can see what you mean? Also, I tried changing everything to int and the...
Type: Posts; User: deleted_user
I don't understand what you mean by "Set your precision to 0, a la %.0f." Could you post an example using my code so that I can see what you mean? Also, I tried changing everything to int and the...
So, I just change it for scanf("%d",&input); Right? That would explain why I go all zeroes. I changed it to %d in every instance. Oh, and how to I get it to display just the number 1 instead of...
When I ran the program, my results were nothing but zeros. Are you telling me that when you ran the program and only changed the %f to %d that it worked?
I tried using %d and it displayed nothing but zeros. Please help me fix this.
Can someone please tell me what is wrong with this program? it is supposed to output 1 gallon, 2 quarts, 1 pint, and 1 cup. The math isn't right on the gallons, It is displaying some strange decimal...
I did look at the FAQs, but I didn't understand how to implement the flush. Would someone please just paste it into my code and help me with this?
Okay, I got it to work. I broke the while loop by adding flushall();
Thank you all for your help!
I'm not using Visual C++. I am writing in C. I am just using this complier to write the program in. Could you please just tell me how to flush it? I tried and it didn't work. I have googled it and I...
I don't even get a chance to enter more input. When i enter the incorrect information and press enter the text just starts scrolling across the screen. I have no opportunity to try entering the...
I just tried it and the text just keeps printing and printing.
Well, okay, maybe I should do all of that, but I don't know how. The loop doesn't wrok as it results in an infinate loop. I thought my program did check the value of scanf. I tried clearing the input...
Okay, I read the FAQs page and I changed the program to this:
#include <stdafx.h>
int main ()
{
int user_input;
I am using Microsoft Visual C++ to write my C program. When I try to use stdio.h it generates an error message and won't let me proceed.
I tried entering the code just as you provided it and the...
How do I do that? I'm completely new to this, so please forgive uninformed questions.
Yeah, I tried a while loop, but when I entered incorrect information to test validation the text "Error: That is not a valid entry! Please enter a number between 0 and 9:" just kept scrolling across...
Hi,
I am trying to write a program that asks the user to enter a number between 0 and 9. I also have to validate the input. That part works just fine. The problem comes in when they enter...