Computer Science, asked by kourjass8820, 11 months ago

Write a program to enter any 50 numbers and check whether they are divisible by 5 or not

Answers

Answered by aartisahu68
1

Answer:

program using c++

Explanation:

#include<iostream.h>

#include <conio.h>

void main()

{

int a,b[50];

cout<<"enter any 50 numbers:";

for(a=0;a<50;a++)

cin>>b[i];

if(b[i]%5==0)

cout<<"divisible by 5";

else

cout<<"not divisible by 5";

getch();

}

Answered by Anonymous
0

import java.util.*;

public class number

{

public static void main(String args[])

{

Scanner in = new Scanner(System.in);

int i;

for(i=1;i<=50;i++)

{

if(i%5==0)

System.out.println("The number is divisible by 5");

else

System.out.println("the number is not divisible by 5");

}

}

}

Similar questions