Newbie C Programer Needs Help ASAP
Well I am curentley taking a C class at my school and am working on a code right now and I am having quite a bit of Trouble. I know most of you have more experance than I therefore I will post what is needed and what I have thus far...I am having troubles with the for loop is there anyway instead of printing out 4
3
2
etc I could get it to throw out the correct amount of * for the number it is inplace of ?
This is what I have so far
/* Written by:
UT
Assignment Number Four
Feb. 21, 2002
*/
#include <stdio.h>
#include <conio.h>
void main (void)
{
int a,z;
do{
printf("Please enter an odd number greater than five...");
scanf("%d", &a);
z=a%2;
}
while (a<5||z<1);
for(z=a ; z > 0; z=z-1)
{
printf("%d\n",z);
}
getch();
}
This is what the Assigment requires.
Use a combination of different structures you have learned to far (sequences, conditions, jumps and loops) to create an output to form:
**********
*******
*****
***
*
You should ask the user to enter an odd number.
Check and discard even, and negative numbers
Odd numbers less than 5 should also be discarded.
Each row has two stars less than the one above
Okay as you can see I am pretty lost any help is appraicted thanks in advance guys