Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/
#include <stdio.h>
int main()
{
int a;
double N[100],b,c,d;
scanf("%lf", &b);
N[a]=b;
for(a=0; a<100;a++)
{
printf("N[%d] = %.4lf\n", a, N[a]);
b/=2;
N[a+1]=b;
}
return 0;
}
Is not correct:
ReplyDeleteYou need to do "a = 0", print the first position, then "for(a = 1; ..."
Why did you declare "c, d" if you didn't use it?