Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int num,i,j,c,sum ;
- printf("please enter the number?\n");
- scanf("%d",&num);
- for (j=1;j<=num;j++){
- for (i=1,c=0;i<=j;i++){
- if (j%i==0){
- c++;
- }
- }
- if (c==2){
- printf("%d\n",j);
- sum =i+j+c
- printf("%d",sum);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement