answersLogoWhite

0


Best Answer

#! /usr/bin/env ruby

n = gets.to_i

d = 'is not'

d = 'is' if n % 7 == 0

puts 'Your number ' + d + ' divisible by seven.'

For more accurate answer, please define the programming/script language you plan to use..

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include <stdio.h>

#define DIVIDE_5 printf("Divided by 5\n")

#define DIVIDE_6 printf("Divided by 6\n")

#define FALSE 0x00

void main()

{

int number = 0x00;

unsigned char divide_5 = FALSE;

unsigned char divide_6 = FALSE;

printf("Enter the Number:");

scanf("%d", &number);

divide_5 = (number % 5) 0x00 ? DIVIDE_6 : FALSE;

if(!divide_6 && !divide_5 )

printf(" Cannot be divided by 5 or 6\n\n");

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

public class Check5Divisbility {

public String checkDiv(int x){

if(x%5 == 0){

return "Yes"

} else {

return "No"

}

}

}

the above method checkDiv can be used to check if the input number 'x' is divisible by 5 or not. The method will return Yes if the number is divisible and No if it is not divisible

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

bool isNumberDivisibleByFive(int number)

{

return(!(number % 5));

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

int num = 0;

int sum = 0;

// 105 is the first integer greater than 100 which is evenly divisible by 7

for(int i = 104; i < 200; i+=7) {++num;sum += i;

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

wap to input a number and check whether it is divisible by 7 or no

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that prompts the user to enter an integer and determines whether it is divisible by 5 and 6 whether it is divisible by 5 or 6 and whether it is divisible by by 5 or 6 but not both?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program that prompts the user to input a positive integer It should then output a message indicating whether the number is aprime or not?

Output a prompt.Either:Read from standard input (std::cin) to an integer.Or:Read a line from standard input (std::getline()) to a string.Create a string stream (std::stringstream) to read the string.Read from the string stream to an integer.For each integer from 2 to half the entered integer:If the entered integer is divisible by the current integer:The number is not prime.Exit the program.The number is prime.Exit the program.


Turbo c program that prompts user to try again?

puts ("Try again");


Write a program in c that prompt user with following lines add two integers test an integer for odd or even and quit?

write a program in C that prompts the user with the following lines: a) Add two integers c) Compare two integers for the larger t) Test an integers for odd or even q) Quit


Write a C program that prompts the user for three decimal numbers and prints them trimmed as integer values. For example, if the user informs the values 13.2, 12.5, 102.231, the program prints out 13, 12, 102?

Here's a simple C program that prompts the user for three decimal numbers, converts them to integers, and prints the trimmed integer values: c Copy code #include int main() { double num1, num2, num3; // Prompt the user for three decimal numbers printf(&quot;Enter three decimal numbers: &quot;); scanf(&quot;%lf %lf %lf&quot;, &amp;num1, &amp;num2, &amp;num3); // Convert and print the trimmed integer values int intNum1 = (int)num1; int intNum2 = (int)num2; int intNum3 = (int)num3; printf(&quot;Trimmed integer values: %d, %d, %d\n&quot;, intNum1, intNum2, intNum3); return 0; } In this program: We declare three variables num1, num2, and num3 to store the decimal numbers entered by the user. We use printf to prompt the user to enter three decimal numbers. We use scanf to read and store the user's input in the variables num1, num2, and num3. We then convert these decimal numbers to integers by casting them using (int) and store them in intNum1, intNum2, and intNum3. Finally, we use printf again to print the trimmed integer values. Compile and run the program, and it will prompt you for three decimal numbers and print their trimmed integer values as requested.


How do you rip a CD to your computer?

You need a program that will do the ripping - the latest version of Windows Media Player does it. After that, select "Rip" or "Copy from CD" or something like that and folow the prompts.


How do you open C when it prompts you to choose the program to open it with with in a list?

edit your autorun.inf file, add the line open=C:\windows\explorer.exe good luck Kevin


How do I install engineering software to my computer?

To install engineering, or any other software to your computer, you first need to put the disc it comes on into the disc drive. Then, you should run the installer on the disc and follow the prompts onscreen. If it is a program that you've downloaded, start the .exe file that you downloaded and follow the prompts that it gives you.


What are some prompts for kids poems?

There are many sources of prompts for kids poems on the internet. Poetry4Kids and Scholastic both publish numerous prompts for kids poems on their websites.


Does vibe navigation unit have voice prompts?

yes is does have voice prompts. you have to increase the volume in the setup?


Do you have to stick to essay prompts?

no


What prompts John Thornton and his partners to travel east and leave Dawson?

gold prompts john thorton to leave dawson


Word that begins with the prefix mis and means prompts a kiss?

It doesn't MEAN "prompts a kiss," it DOES prompt a kiss, and it is mistletoe.