Computer Science, asked by SupriyaSahoo, 1 year ago

write a program to enter any 10 numbers and print how many numbers are divisible by 5

Answers

Answered by nitish8089
3

c +  + ..
#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++
nitish8089: i know small basic, java, kotlin, language also...
nitish8089: would small basic work same..
SupriyaSahoo: no i m not tech genius. in our school we have not taught to write in this way
SupriyaSahoo: o sorry
Answered by Stuti1230
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