There is actually no need to create an array, the problem can be solved using just two "loops". Dont use the function "clrscr()" since it kills program portability and it is a non standard function. If possible try to move from the age old turbo compiler to the list of new compilers provided in the thread mentioned below.
And as far as the thing that you are a newbie is concerned, if you are in need of tutorials, look at the sticky at the top of the forum named "Starting C", it can help you a lot.
Also here is a sample of how you can do it and i wont tell you how to solve the rest of them, you need to think about them.
int main (void)
int i, j ;
for (i = 5; i > 0; --i)
for (j = i; j > 0; --j)
printf ("%d", i) ;
putchar ('\n') ;
getchar () ;
return 0 ;
hmm. This thread is quite old, I guess the OP has allready solved his problem.
Now for a few tips on your code:
- Don't use getche() use the standard function getchar() instead.
- Don't use clrscr; it makes you code non-portable
- The prototype (one of two) for main() is [B]int[/B] main(void) not main()
- When taking the above in account, you don't need to include <conio.h> anymore.
Yes I can. But first you should make a new thread for this question, it it not allowed to piggyback (or hijack) other threads. Then show what you have done so far.
You should use the searchfunction here on daniweb because there are *a lot* of threads about pascaltriangles here.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...