Hi, This is the code that i've written so far, I'm having some problems configuring the for loops..... can anyone help?? here is the code
[CODE=c]#include <stdio.h>
int main(){
int number[501];
int i,bulb,incr,j;
bulb=1;
bulb++;
incr=bulb;
for(i=bulb;i<=5 01;i+incr)
{
...
User Profile
Collapse
-
-
hey,thank you. i have to input the number rather than the text but i got the idea.i'll work wit it..thank you...Leave a comment:
-
yes,i know tht.but i tried using the array with one number in it..it still didnt work.i need to assign values(ones,ten s,hundredths) .i need to tell the computer tht in the case of 768,7 is a hundred,6 is a ten,and 8 is a one....can anyone plz tell how i can do tht.i've been reading and i cant find a way to do it.thank you very muchLeave a comment:
-
yes,i know tht.but i tried using the array with one number in it..it still didnt work.i need to assign values(ones,ten s,hundredths) .i need to tell the computer tht in the case of 768,7 is a hundred,6 is a ten,and 8 is a one....can anyone plz tell how i can do tht.i've been reading and i cant find a way to do it.Leave a comment:
-
i think the array should only have one number(i have 3 in the array above),its supposed to just be a 3 digit number..one number.can anyone help me with tht..thnxLeave a comment:
-
Input numbers output words problem
Hello,i'm wondering if anyone can help me. The c program needs to input any number from 1-999 and it must output whatever number was input in words.i have made a start on the hundredths and tens...can anyone help me with wht i can use to input the data? When i compile and run the program,only if i put in a single digit then it prints (eg if i put in 5) five hundred, for 3 digit numbers it doesnt print anything.I think the problem is inputing the... -
Help required for C program
Hello, Is it possible that someone can help me with the following program?
There are 500 light bulbs (numbered 1 to 500) arranged in a row. Initially they are all OFF. Starting with bulb 2, all even numbered bulbs are turned ON. Next, starting with bulb 3, and visiting every third bulb, it is turned ON if it is OFF, and it is turned OFF if it is ON. This procedure is repeated for every fourth bulb, then every fifth bulb, and so on...
No activity results to display
Show More
Leave a comment: