I dont understad why this code does not work, it doesnt go through loop, but just prints out 1111 all the time
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "pch.h"
#include <iostream>
usingnamespace std;
int main()
{
int a, x, y;
cout << "Ievadiet skaitli a ";
cin >> a;
for (x = 1; x <= 5; x++) {
if (x = a) {
y = 1;
cout << x << y;
}
}
}