Greetings,
I've been fighting with this program for some hours now, and there are so many things the program is requesting that I'm overwhelmed, I was wondering if anybody can point me in the right direction.
I need a program that will calculate products based on user command (1 or 0), the user will select a number before this so that it can become the last number to be multiplied.
If user inputs 0, calculate: 1*3*5*…*n (n is an odd number picked by the user)
or 1*3*5*…*(n-1) (n is an even number picked by the user);
If user input 1, calculate: 2*4*6*…*(n-1) (n is an odd number picked by the user)
or 2*4*6*…*n (n is an even number picked by the user).
So far I got...
Code:
#include<stdio.h>
int main()
{
int n;
int command;
int result;
int usernumber= 0;
printf("Please input a positive integer:");
scanf("%d", &n);
printf("Please input the command for computation of products:");
scanf("%d", &command );
If (command == 1, usernumber++){
do{
printf( "%d", result);
}
while( nums > n )
}
}
Please halp D: