No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hey guys, I'm building a program in C that can get powers of 2. The user inputs the value of n, and the program calculates 2^n. Here's the code #include <stdio.h> double power(int n) { int q; double c=2; for (q=n; q>1; q--) {c=2*c;} return c; } int main() { … |
|
Well, I need to code a pyramid that prints the following pyramid WITHOUT the stars *********1 ********232 *******34543 ******4567654 *****567898765 ****67890109876 ***7890123210987 **890123454321098 *90123456765432109 0123456789876543210 In the center, there are prime numbers, from 1 to 9, and after that, they cycle. (1,3,5,7,9,1,3,5,7,9 and so on). I made the code for … |