write a program to enter any 10 numbers and print how many numbers are divisible by 5
Answers
Answered by
3
#include <iostream>
using namespace std;
int main() {
int a[10];
int c=0;
cout<<"Enter the 10 elements.. \n";
for(int i=0;i<10;i++){
cin>>a[i];
}
cout<<"Display the elements... \n";
for(int i=0;i<10;i++){
cout<<a[i];
}
cout<<"............................ \n";
cout<<"no. of element divide by 5 \n";
for(int i=0;i<10;i++){
if(a[i]%5==0){
cout<<a[i]<<" ";
c++;
}
}
cout<<"\n total number divide by 5 is "<<c;
return 0;
}
SupriyaSahoo:
thank u ,I want basic programming not c++
Answered by
0
It is a program of QBASIC:
CLS
FOR I = 1 TO 10
INPUT "ENTER A NO. :" ;A
IF A MOD 5 = 0 THEN
PRINT A
C = C + 1
ENDIF
NEXT I
PRINT " NO. OF NUMBERS ENTERED THAT ARE DIVISIBLE BY 5 ; C
END
Similar questions