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,b,c=0,x,z;
scanf("%d", &x);
do{
scanf("%d", &z);
}
while(x>=z);
for(a=x,b=0; b<z; a++)
{
b+=a;
c++;
}
printf("%d\n", c);
return 0;
}
int main()
ReplyDelete{
int x,y;
int num=0,sum=0;
scanf("%d",&x);
do
scanf("%d",&y);
while(x>=y);
while(y>sum)
{
sum=sum+x;
x++;
num++;
}
printf("%d\n",num);
return 0;
}
//PLs check my code
#include
ReplyDeleteint main()
{
int x,z,n=0,j,i,k,sum;
scanf ("%d",&x);
do
{
scanf ("%d",&z);
}while(x>=z);
for(j=x;jz)
{
n++;
}
j=i++;
}
printf ("%d\n",n);
return 0;
}
where is my fault???
plz help me to find my wrong place ...