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,d,e,f; scanf("%d", &a); for(b=1; b<=a; b++) { c=b*b; d=b*b*b; printf("%d %d %d\n",b,c,d); } return 0; }
// sir why did doesn't work
ReplyDelete#include
#include
using namespace std;
int main ()
{
int n , k = 1;
cin >> n;
for (int i = 1 ; i<=n ; ++i)
{
k = 1;
for(int j = 1 ; j <= 3 ; ++j)
{
cout << i*k << " ";
k*=i;
}
cout << endl;
}
cout << endl;
}
Because of an extra space count end of the line. I faced the same problem... When i debug it i can fix it...
Delete/* Why it is showing Presentation Error */
ReplyDelete#include
#include
int main()
{
int n,m=1,i,j;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=3;j++)
{
m=m*i;
printf("%d ",m);
}
printf("\n");
m=1;
}
return 0;
}
/* Why dosen't this working ,sir ? */
ReplyDelete#include
int main()
{
int i,j,a,e;
scanf("%d",&a);
for(i=1;i<=a;i++)
{
for(j=1;j<=3;j++)
{
e = pow(i,j);
printf("%d ",e);
}
printf("\n");
}
return 0;
}