Nothing like getting an early start on the old homework assignment! :D
Type: Posts; User: gabulldog
Nothing like getting an early start on the old homework assignment! :D
I voted for team 1.
What's the contest?
Who's on team 1?
First degree: Journalism. Didn't do me a whole lot of good.
Second degree: Computer Science. I get to use it in my current job and I'm having a blast.
Went to business school for a year to...
for ( counter =1 ;counter=factorial; counter++ )
{
answer = counter*factorial; }
printf( "%d", counter );
return 0;
It appears from this code, the only thing your project is going to print...
while ( counter <= firstValue )
{
printf( "Enter integer: " );
scanf( "%d", ¤tNumber );
smallestNumber = firstValue;
It looks like this section of code will not do what you...
First, no, you do not need to declare structures outside function main. In order for your structures to work, you need logical code.
I noticed many typos as well as logic errors in your code.
...
One loop rules.
All others are wannabees. :D
It's mandatory where I work. Charting the process saves both time and money. The documentation that results helps people in your situation understand the code you must translate.
If the code confuses you, I recommend you walk away from the computer with a blank piece of paper and a pencil, and sit down to figure out exactily what you are trying to accomplish.
Start in...
Good start.
First, your function allTime needs to return a value for you to put into totTime. Your function is of type int, but I recommend you change it to type TIME:
TIME allTime (); ...
Show us what you have so far and then maybe we can offer some advice on how to work the problem.
Smart developers > any compiler :cool:
Compiles fine on Microsoft's Visual C++ compiler:)
Doesn't run though :eek:
fmod returns the remainder of a divisor and dividend presented by the code. It is a very useful tool, but you need to remember that floats and doubles are not always exact, so you might not get the...
What you need to do is figure out how to come up with the positive proper divisors. I've looked at the first three perfect numbers and have seen a pattern, which is the sum of the perfect number (b)...
Sorry I couldn't get back to you in time. Good luck.
When you set your arrays up, make sure the position of the number and the type of shape are the same. eg:
int shapenum[6];
char *shapetype[6];
shapetype[0] = "circle";...
The question I have for you is what is list supposed to accomplish? If you want to get the multiple numbers, you already have a form of them in i, j and k. You just need to figure out how to print...
It's never too late. You are almost there.
I recommend you go back to the original posting and use the printf call you had there. Change it to
printf("\Prefect number: %.0f = ", b);
or...
I guess my point is you changed the output of your prefect function from the result of your calculations to an uninteligible output.
If you trying to get something like:
"6 = 1 + 2 + 3"
...
Prior to attempting to fix your list function (which has lots of problems), perhaps you should look at the output of your prefect function.
if (b <= 1000000000)
{
printf(" %.lf =...
It depends on what you want to do. C has been used in so many applications, it will probably be decades before it goes away, if ever. I know Fortran and COBOL programmers who are still gainfully...
I tried your code and it worked OK for me. No negative numbers, but the prefect number goes above 1,000,000.
To get rid of that problem, perhaps you can try this:
#include <stdio.h>...
try this:
[Code:]
int x, b, k, y;
int prefect(int b);
void main ()
{
prefect(b);
Having two pointers makes it easier to traverse and edit the list.