I can't understand ..where to put open braces{ and closed braces in these given coding and why we put i=2 and at last i==num | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

I can't understand ..where to put open braces{ and closed braces in these given coding and why we put i=2 and at last i==num

#include<stdio.h> int main() { int num,i; printf("Enter the number\n"); scanf("%d",&num); i=2; while(i<=num-1) { if(num%i==0) { printf("this is not a PM"); break; } i++; } if(i==num) printf("prime number\n"); }

30th Nov 2021, 10:00 AM
MOHAN SHARMA
MOHAN SHARMA - avatar
1 ответ
0
i find it easier to use indentation as well. https://code.sololearn.com/ciNBO5hV4s8R/?ref=app
30th Nov 2021, 10:12 AM
Slick
Slick - avatar