I assume you mean is an if the number is an integer multiple of 3
i am unfamiliar with C but the theory would be,
find if a is integer multiple of 3
b=a/3
b==round(b).
if 1 "yes"
else "no"
this is an inefficiency way but will get the job done
if ( x % 6 == 0 ){ printf( "%d is divisible by 6", x ); } else { printf( "%d is not divisible by 6", x ); }
Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
Reference:http:cprogramming-bd.com/c_page2.aspx# strange number
#! /usr/bin/env rubyn = gets.to_id = 'is not'd = 'is' if n % 7 == 0puts 'Your number ' + d + ' divisible by seven.'For more accurate answer, please define the programming/script language you plan to use..
write a c++program by using if statement to read a number and check whether it is positive or negative
if ( x % 6 == 0 ){ printf( "%d is divisible by 6", x ); } else { printf( "%d is not divisible by 6", x ); }
What for? There is only a 154 inside that is divisible by 77...
I suggest you write an outer loop, that loops through all the numbers from 1 to 50. Call the variable that controls the loop something like "number".Then, initially assume the number is a prime (with a variable such as "isprime"); and write another loop that compares whether the number is divisible by any number from 2 to number-1. Call the controlling variable "factor". If number is divisible by factor, then it is not a prime, and you can exit the loop. At the end of the inner loop, if the variable "isprime" is still true, then you print the number.
int isDivisibleByTwo(int N) return N % 2 == 0;
Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11
Yes.
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
15
write a program in C to check whether a given number is apalindrome or not
Write a program to convert a 2-digit BCD number into hexadecimal
Reference:http:cprogramming-bd.com/c_page2.aspx# strange number