ACP1_7

#include<stdio.h> void divall(int []); void main() { int no[10],a; clrscr(); printf("\nEnter 10 no.s :\n"); for(a=0;a<10;a++) { printf("No. %d : ",a+1); scanf("%d",&no[a]); } divall(no); getch(); } void divall(int no[]) { int a,b,count,flag; for(a=0,flag=0;a<10;a++) { for(b=0,count=0;b<10;b++) { if((no[b]%no[a])==0) count++; else break; } if(count==10) { flag++; printf("\n%d divides all other number in array.",no[a]); } } if(flag==0) printf("\nNo number divides all other numbers."); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.