0
Can anyone help me please for some activity 🙏🏻
1. Write a C program that print numbers From 1 to maximum number entered by the user. 2. Write a C program to sum all even number from 1 to a maximum number entered by the user. Hint: We call X is an even number if and only if the reminder of (X %2) is zero. 3. Write a C program to find the average of all odd numbers from 1 to a maximum number entered by user.
11 Antworten
+ 2
we'll glad to help if you need :)
but, do what you can first if you confuse about some part, or got an error and dont know how to fix you can ask here anytime, we'll answer if we can. it's learning platform after all
0
Taste But I do not know how to start here 💔
0
D_Stark ohh thank you soo much i will write it now
0
Taste
#include<stido.h>
int main()
{
int x;
int maxNo;
printf(“Enter maximum number:”);
scanf(“%d”, &maxNo);
for(x=1; x<= maxNo; x++);
printf(“%d”, x);
return 0;
}
Where is the problem here?
0
remove ; after for statement
0
oh i’m sorry but i don’t write ; after for statement in my program 😅
Taste
0
for(x=1;x<=maxNo;x++); <-- here
0
yes i know but i dont write it in my program
i’m write program in my lab not in my phone
Taste
0
when i’m write the program her i’m forgot and write it but in my program i dont write it Taste
0
so the task is print number 1 to n, where n is the input right ? other than typo in stdio and semicolon after for its all right, it should works perfectly. and dont forget to add space at the output
0
Taste I solved the problem thanks