Narendra Modi ji visits prime countries

sir i wrote this code without using the cumulative sum approach but when i input a=1 and b=10 then i get answer as 5 not as 4. same is the case when i input a=11, b=20.

i am getting an answer in which 1 is added in excess. why is it so?? here is the code i wrote -

please somebody look into this and tell me what am i doing wrong???

hello @pushkar24sharma

start i from odd number (1 or 3)

and use long long for both (inner as well as outer) loops

1 Like

ok thank u @aman212yadav sir. that was my mistake :sweat_smile: :sweat_smile:
now it is working fine