User Profile
Collapse
-
o.k. I tried it several ways. I hope I can just insert a \n in the right spot to solve the problem but I can't figure out where or if it is possible. -
print 1-50 as a block of 5 rows 10 columns using a function
o.k. so i can't program and this is child's play to most of your.
I am struggling with understanding functions. Here's what I have.#include <stdio.h>
[CODE=c] void row (int);
int main (void)
{
int x=41;
int i;
for (i=1; i<=x; i+=10)
printf("%d",i);
row (int j);
}
void row(int j)... -
program to find divisors of 1-50
I have written the program for factors of #'s 1-50 but the factors print out below the number being factored. I can't figure out how to make it all on the same line.
i.e. (now) divisors of 25 are
1
5
25
(need) divisors of 25 are 1, 5, 25.
here is my code;
[CODE=c]#include <stdio.h>
int main()
{
int i;
int x=50;... -
yes. the instructor asks us not to use calculus rather compare values for fx and then print the maximum value. that is where I am stuck.Leave a comment:
-
finding the max of a function
Here is my code. the function is 500x-10x^2. i am trying to find the largest fx, call it max and print it.
[code=c]
#include <stdio.h>
#include <math.h>
int main(void)
{int fx;
int x=0;
int max;
int a=50;
int fxnext;
printf("f(x) x.\n");
printf("-----\n");
while (x<a)
{... -
-
O.k. Thanks for your help. I understand the algorithm and tried an "else" statement.(it seems simpler this way) I get one error here and don't know what I am missing. This is c not c++ and my original post had some integer mistakes.
[CODE=c]#define _CRT_SECURE_NO_ DEPRECATE
#include <stdio.h>
int main( void )
{
int year, a, b, e;
a = 4;
b = 100;...Leave a comment:
-
is it a leap year in c++
here's what i have. using microsoft studio
[CODE=c]#define _CRT_SECURE_NO_ DEPRECATE
#include <stdio.h>
int main( void )
{
int year, b, c, e;
b = 4;
c = 100;
e = 400;
/* prompt the user for a year to check */
printf("Enter a year: ");
scanf("%d", &year);
/* put your code below here */...
No activity results to display
Show More
Leave a comment: