repl.it
@CullenDAvello/

legion repl

C

i am new(ish) to c coding i know the basics but not enough, this is just something i am learning in my spare time

fork
loading
Files
  • main.c
  • main
  • main.cpp
  • window?.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

int main(void)

{
  int fahr, celsius;
  int lower, upper, step;

  upper = 300;
  lower = 0;
  step = 20;

  fahr = lower;
  while (fahr >= upper){
    celsius = 5 * (fahr - 32) / 9;
    printf ("%dt%d\n", fahr, celsius);
    fahr = fahr + step;
  }
}