I implimented your changes and I got it to work:
// PA
#include <stdio.h>
#include <stdlib.h>
#define LINE_MAXLENGTH 80
int main(void)
Type: Posts; User: powerfox0
I implimented your changes and I got it to work:
// PA
#include <stdio.h>
#include <stdlib.h>
#define LINE_MAXLENGTH 80
int main(void)
Could you explain to me why did you change what you changed?
wouldn't the default case in my switch statement make up for that? i took the case "DA" out, still same issues
EDIT: I tried using fgets and I ran into a bunch of errors.... i think fscanf will...
the input is
DA
H
+ 3 5
- 5 3
* 10 7
/ 90 10
H
* 8 10
+ 2 8
The DA was there originally from my teacher..I even changed input file and removed DA. still not giving me anything printed to screen for + or - as op values....
// PA
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
float num1, num2;
char op;
Help....
is there a way in c to make it so if it reads any variable BESIDES +-*/HQ it goes to the next line again?
so should I put another case for variable DA? I heard something about flushing input values but am not sure how that works
could it be the EOF thats messing up my output?
[QUOTE=CodeMonkey;1204886]How to use a loop function with user input in C? - Stack Overflow
Checking for EOF in 6 places can't be the best way, right?[/QUOTE=CodeMonkey;1204886]
thank you for...
Hello there, I am fairly new to programming, but i understand the basics (sort of)... I am working on a calculator for my class, and i have run into a speedbump of sorts. I cannot get the program to...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int sum1;
sum1 = 7+3*5-2;
printf("the first equation is 7+3*5-2 \n");
printf("the answer of the first...
understood, now can you help me with the errors? it seems to be only with the last sum.... what might it be?
also how can i get each answer to display on a seperate line?
here is what I got for the first part, but once again i am encountering errors, specifically 2 errors at line 12 saying error: stray '\226' in program and error: expected ';' before numerical...
THANK YOU! yes got the second part working perfectly, now just to get the first part underway
this is for the second algorithm, but I keep encountering an error at last line, says error: expected declaration or statement at end of input. Any help?
#include <stdio.h>
#include <stdlib.h>...
well i have done it mathematically, I just have no prior knowledge of writing anything in code, what would be the basic steps?
Hello everyone, this is my first time posting here so any help would be appreciated. i am currently taking a class on C language, its an intro class. I have no previous knowledge on how to work with...