In this page I have written the program to find the numbers that are divisible by one number and not by another number. For more information
lets have a view for main source code. I have also added sample output of the program:
The main source code for this program is:
lets have a view for main source code. I have also added sample output of the program:
The main source code for this program is:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int main() | |
{ | |
int array[100],count=0,sum=0,n1,n2,n,i; | |
printf("how many terms you want to test\n"); | |
scanf("%d",&n); | |
printf("Enter the no. you want to test\n"); | |
for(i=0;i<n;i++) | |
{ | |
printf("enter element no. %d\n",i+1); | |
scanf("%d",&array[i]); | |
} | |
printf("From which no. the above no. should be divisible\n"); | |
scanf("%d",&n1); | |
printf("From which no. the above no. should not be divisible\n"); | |
scanf("%d",&n2); | |
printf("\n"); | |
printf("\n"); | |
for(i=0;i<n;i++) | |
{ | |
if(array[i]%n1==0 &&array[i]%n2!=0) | |
{ | |
count++; | |
printf("\t%d", array[i]); | |
} | |
} | |
printf(" are the required elements that is divisible by %d but not by %d",n1,n2); | |
printf("\nthe total number of required elements=%d",count); | |
getch(); | |
} |
Caesars, Bally's & Gila River, Arizona - DrmCD
ReplyDeleteFind 광주광역 출장안마 Caesars Casino, Bally's 거제 출장안마 & Gila River, Arizona, rates, amenities: 영천 출장샵 expert AZ 김천 출장마사지 research, only at Hotel and Travel 세종특별자치 출장샵 Index.