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 N[10], a, V;
scanf("%d", &V);
for(a=0; a<=9; a++)
{
N[a]=V;
printf("N[%d] = %d\n",a,V);
V*=2;
}
return 0;
}
#include
ReplyDeleteint main()
{
int V,i,N[10],X;
scanf("%d",&V);
X=V;
for(i=0;i<10;i++)
{
N[i]=X;
printf("N[%d] = %d\n",i,N[i]);
X=X*2;
}
return 0;
}
reply
#include
ReplyDeleteint main()
{
int n,i,a,x;
scanf("%d",&n);
for(i=0;i<10;i++)
{
x=n;
printf("N[%d] = %d\n",i,x);
x=x*2;
n=x;
}
return 0;
}
reply...