Program to calculate all prime numbers upto n

in output it is only showing 2 and 3 and not numbers after that.
this code was taught by sir in one of his pseudocode videos.

@prathamkhandelwal2003_92391ed6235d0029 Hi do flag = 1 inside first for loop

hi sir,
thank you for answering my doubt
it worked
but i did not understood that what is the difference in writing (flag=1) inside for loop or in the startinng of the program.

@prathamkhandelwal2003_92391ed6235d0029 Fir each no it should be initialised that’s why

1 Like