PRIME NUMBER ON GIVEN RANGE

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

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...