PRIME NUMBER OR NOT

1.  #include<stdio.h>
2.  #include<conio.h>
3.  void main()
4.  {
5.  int n,i;
6.  clrscr();
7.  printf("\n\t enter any number ");
8.  scanf("%d",&n);
9.  for(i=2;i<=n-1;i++)
10.     {
11.     if(n%i==0)
12.     {
13.     break;
14.     }
15.     }
16.     if(n==i)
17.     {
18.     printf("\n\t prime number ");
19.     }
20.     else
21.     {
22.     printf("\n\t not prime number ");
23.     }
24.     getch();
25.     }
25.     }
26.     getch();

27.     }
Output

No comments:

Post a Comment

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II :   1) Which of the following is the extension of Not...