Write a program to accept a number and check whether the number is
divisble by both 2 and 3 or not, without using && operator
Answers
Answered by
0
{
int n;
int I=2;
while(I<4)
{
if(n%2==0)
{
cout<<I;
}
i++;
}
Answered by
0
Answer:
#include <stdio.h>
int main()
{
int a;
printf("enter the number");
scanf("%d",&a);
if(a%2==0)
{
if(a%3==0)
printf("it is divisble by 2 and 3");
}
else{
printf("it is not divisble");
}
return 0;
}
Output
enter the number 6
it is divisible by 2 and 3
Similar questions