Study guides

☆☆

Q: How do you write a program to test if a given number is divisible by 6 in C programming?

Write your answer...

Submit

Still have questions?

Continue Learning about Engineering

The sum and average of a given number is just that number, so there is no need to write a program.

/*Title: even.cA simple C program to find if the given number is even or not.*/#include int main(){int number;/* prompt the user for a number */printf("\nNumber: ");scanf("%d" , &number);/*Check if the number is even or not. A number is even if it is divisible by 2.The remainder is zero.*/if(number % 2 == 0)printf("The number %d is even\n" , number);elseprintf("The number %d is odd\n" , number);return 0;}

Object Oriented Programming has everything to do with a programming language. Programming Languages are classified into: 1.Object Oriented Programming 2.Process Oriented Programming In Object Oriented Programming, more stress is given to data rather than Algorithm of the program giving the programmer his fre will to do anything without violating few rules of programming(like grammatical errors). Object Oriented Programming breaks the program into small objects so as to make it easily changable & to prevent free flow of data and also to create a logical insulation between the program and outside world.

Write a C program to count the number of characters in a given string with and without using srtlen() function

Computer programming is either imperative or declarative. Declarative programming states what a program is to do, but not how to do it (the how being determined by the language implementation). Conversely, an imperative programming language states how to perform a given task, usually as sequence of functions or sub-procedures using any combination of procedural, structured and object oriented programming.

Related questions

void main(){ int i,j; scanf("%d",&i); if((i%5)==0) printf("the given number is divisible by 5); }

Sol: 24 = 3 x 8, where 3 and 8 are co-primes. The sum of the digits in the given number is 36, which is divisible by 3. So, the given number is divisible by 3. The number formed by the last 3 digits of the given number is 744, which is divisible by 8. So, the given number is divisible by 8. Thus, the given number is divisible by both 3 and 8, where 3 and 8 are co-primes. So, it is divisible by 3 x 8, i.e., 24.

a multiple

With out programming a computer will do nothing. The program tells the computer what to do when various command are given.

If the sum of the digits of a given number is divisible by three, the number is divisible by three.

4 is the smallest composite number and it is not divisible by the two given numbers.

No. A given number need not even be divisible by a given prime.

Those are multiples.

It is not possible to answer this question. There is no such word as divisble and I am assuming that it is meant to be divisible. However, you cannot "divisible by 4". Divisible by 4 is a property that some numbers have and others don't and you can check if a given number is divisible by 4. Alternatively, you can divide by a given number by 4.

To get complete tutorials of "c programming" Reference:programming-bd.com/c_page2.aspx# prime number

8.

The LCM of the given numbers is 12

People also asked