I recently installed this on a new windows and now whenever i type even the simplest of codes it just shows random numbers back as a result. Even when i simply add 2 integers, which worked perfectly fine before and the problem isn't with the code itself, it just shows random numbers and even if i type the same thing again it shows different random numbers than before. I hope my explanation was understandable. This has probably fixable somewhere in the settings menu but i can't find it, nothing mentioned on the internet either. How do i fix this? Thanks in advance.
Edit: Using c++ on code::blocks if that is of any importance.
Mate, you see why it's a problem when you do c = a+b; before giving a & b a value right? I mean, a & b have garbage values, You want to obviously ask first, and then do it.
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
usingnamespace std;
int main()
{
int a, b, c;
cin>> a >> b; // ask for the a & b values
c = a+b; // and then put c = a+b, not the other way around.
cout<< c;
return 0;
}