Hi, i am new to C language. Yesterday was my first day.
I have to small programs. One that converts Fahrenheit to celsius in 20 degree increments and one that does it in 15 degree increments. they work fine but i was playing around with it and i wanted to make a Main file that calls both of them and displays the results.
here is how my files look.
Code:
#include <stdio.h>
/* convert Fahrenheit to celcius in steps of 20*/
int steps = 20; //increment steps
Code:
#include <stdio.h>
/* convert Fahrenheit to celcius in steps of 15*/
int steps = 15; //increment steps
this is the main.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <f_to_c.h>
#include <f_to_c2.h>
int fahr;
int cels;
int min = 0;
int max = 300;
main() {
fahr = min;
while(fahr <= max){
cels = 5 * (fahr - 32) /9;
printf("%d\t%d\n", fahr, cels);
fahr = fahr + steps; //increment fahrenheit by 20 degrees
}
}
when i run this, i get some error messages.
Main.c:10:20: f_to_c.h: No such file or directory
Main.c:11:21: f_to_c2.h: No such file or directory
Main.c:26: error: `steps' undeclared (first use in this function)
Main.c:26: error: (Each undeclared identifier is reported only once
Main.c:26: error: for each function it appears in.)
thank you in advance