Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
Why this programm doesn't work?
+2
votes
asked
Nov 13, 2019
by
Anton
#include <stdio.h>
#include <math.h>
int
main ()
{
int n, i, c,s, b,a,r=0;
scanf ("%d %d", &a, &n);
s=s+a;
for (i=0; i<=n; i++)
{
b=10*r;
c=a*b;
s=s+c;
r++ ;
}
printf ("%d", s);
return 0;
}
c
-for
loops
needhelp
-help-plz-
Please
log in
or register to answer this question.
14 Answers
0
votes
answered
Jan 8, 2020
by
Suryateja Koka
(
140
points)
it is properly working
give a printf to help others to know entering values
Please
log in
or register to add a comment.
0
votes
answered
Jan 14, 2020
by
Chandra Sagar
(
260
points)
yes it is working right once go through again
Please
log in
or register to add a comment.
0
votes
answered
Jan 24, 2020
by
anonymous
it's running perfectly. All you need is to declare s=0.
Please
log in
or register to add a comment.
0
votes
answered
Jan 25, 2020
by
anonymous
because you should initiate the value of s=0 while declaring variable so variable s can not store the garbage value.
Please
log in
or register to add a comment.
Page:
« prev
1
2
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...