English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Write a C program to read a number having more than 5 digits and print whether the given number is divisible by 11 or not by using the algorithm which states that a number is divisible by 11 if and only if the difference of the sums of digits at odd positions and even positions is either zero or divisible by 11.

2006-09-13 05:36:57 · 9 answers · asked by Anonymous in Computers & Internet Programming & Design

9 answers

The only thing that blew my mind was that you actually tried to make your homework assigment sound exciting.

2006-09-13 09:12:34 · answer #1 · answered by stratsandlespauls 6 · 0 0

Didn't you already ask this question? It's not a hard thing to do. It is literally 5 lines of code, and that's if you actually bother to tell the user to enter the five digit number.

2006-09-13 06:31:42 · answer #2 · answered by Chris J 6 · 0 0

And after you graduate and get a job, just who do you think you'll con into doing your work for you for 10 answer points? Get over this quick and get on with doing your homework for your own good!

2006-09-13 05:58:18 · answer #3 · answered by Anonymous · 0 0

Dude, are you asking for a complete program? You can visit this site for free C source code: http://smartcoder.awardspace.com/
Go to the C++/C category.


KaBalweg
http://smartcoder.awardspace.com/

2006-09-13 05:43:57 · answer #4 · answered by dabsani 3 · 0 0

#include

main()
{
int t=1;
long int n=0;
long int a=0,b=0;
int s1=0,s2=0;

printf("enter the number");
scanf("%ld",&n);

a=n;
b=n/10;
while(a>=1)
{
t=a%10;
s1=s1+t;
a=a/100;
}

while(b>=1)
{
t=b%10;
s2=s2+t;
b=b/100;
}

if(s1==s2)
printf("the number is divisible by11");
else
printf("the number is not divisible by 11");



}

2006-09-15 22:22:26 · answer #5 · answered by Anonymous · 0 0

this is simple discrete math - and on top of that you were already given the algorithm!

Do your own homework.

2006-09-13 05:46:38 · answer #6 · answered by Anonymous · 1 0

And what do I do after?

2006-09-13 05:40:26 · answer #7 · answered by Geneddly 4 · 0 0

i will send you email wait for program.

2006-09-13 05:41:44 · answer #8 · answered by rajashekhar_hubli 1 · 0 2

I can do it

2006-09-13 05:38:45 · answer #9 · answered by Sandeep C 1 · 0 1

fedest.com, questions and answers