Running code on different IDEs is giving me different results

I apologize for my bad grammar and spelling in advance.
I’m trying to learn C, but when I run code in cs50.dev I’m getting different results from when I run it in VS Code.
Here is the code

#include <stdio.h>

// Print Fharenheit-Celsius table for fahr = 0, 20, ..., 300

int main()
{
    float fhar, celsius;
    float lower, upper, step;

    lower = 0;   // Lower limit of temperature
    upper = 300;    // Higher limmit of temperature
    step = 20;  // step size //

    printf("\nFhar           Celsius\n----------------------\n");   // underlining table

    fhar = lower;
    while (fhar<=upper)
    {
        celsius = 5.0 * (fhar-32.0) / 9.0;
        printf("%3.0f        |\t %6.1f\n", fhar, celsius);    // after using $f for example always add what your referancing and by order // seperating table
        fhar = fhar + step;
    }
}
//print Fahrenheit-Celsius table for fahr = 0, 20, ..., 300

This is the result I get in VS Code

Ah, I can only upload 1 screen shot. The result I’m getting in cs50.dev is only showing Fhar and Celsius headers once, and only displaying the ------------- once

I’m just rather confused, have I set up VS Code wrong? Or am I in way over my head?

I hope I made sense and you were able to understand what I’m getting at.

Sorry for the formatting , I’m really not sure what I’m doing lol

Something is definitely incorrect about what VSCode is showing you, though I don’t know why, as your code looks correct to me.

Ah no problem, thank you for looking at it :). Should I stick with the cs50.dev while learning and ignore VS Code for now?

Getting compilers set up correctly with VSCode can be a real pain. Sometimes it takes multiple attempts.

Hi all, for some reason it has resolved itself. I’ve no idea why and I’m not looking the gift horse in the mouth. Thank you all for having a look :slight_smile:

If I had to guess, I’d put my money on the fact that the shell needed to be restarted for changes to take effect.