Computer Science, asked by Gauravphulwani, 10 months ago

6.Write a program to check whether an int type number (taken as input) is a multiple of 5 or not.
7. Write a program to check whether an int type number (taken as input) is a 2-digit number or not.​

Answers

Answered by vaishnavik052
3

Answer:

6)

#include<stdio.h>

#include<conio.h>

void main()

{

int n;

printf("\n enter the number");

scanf("%d",&n);

if(n%5==0)

printf("%d is multiple of 5");

else

printf("%d is not multiple of 5");

getch();

}

7)

#include<stdio.h>

#include<conio.h>

void main()

{

int count=0,n;

printf("enter the number");

scanf("%d",&n);

while(n!=0)

{

n=n/10;

++count;

}

printf("number of digits=%d",count);

getch();

}

Explanation:

Answered by CopyThat
8

Answer:

JAVA:-

Explanation:

import java.util.*;

class Brainly

{

static void main()

{

int n;

Scanner sc=new Scanner(System.in);

System.out.println(“Enter an integer:”);

n=sc.nextInt();

if(n%5==0)

System.out.println(“Multiple of 5”);

else

System.out.println(“Not a multiple of 5”);

}

}

Similar questions