# A program to print all prime numbers between-10 to 100.
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int i,n,f,rang,c;
- clrscr();
- for(n=10;n<=100;n++){
- f=0;
- for(i=2;i<n;i++)
- if(n%i==0){
- f=1;
- break;}
- if(f==0)
- printf("%d ",n);
- else
- printf(" ");
- }
- getch();
- }
RULES & output:
1.Program type:used by for loop and if else.
2.Simple input:10-100
3.Simple output:11 13 17 19 23 ………………97.
No comments:
Post a Comment