CODE
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int i,j,k=0,count=0;
printf("Enter an integer: ");
scanf("%d",&i);
j=i;
for (i;count<=10;i++&&count++) printf("%d ",i);
printf("\n");
count=0;
for (j;count<=10;j++&&count++) printf("%d ", j*j);
printf("\n");
for(j;j<=10;j++) {printf("%d ",j*j); k+=j*j;} printf("%d ",k);
system("pause");
return 0;
}
look at second for loop. you are incrementing j there and then
look at third for loop, you are not setting j to 0.
so j is 11 here and third for loop does not executes.
and I am not getting that && thing in for loop. I think a simple comma will do there.
here are the modified code
CODE
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int i,j,k=0,count=0;
printf("Enter an integer: ");
scanf("%d",&i);
j=i;
for (i;count<=10;i++,count++)
printf("%d ",i);
printf("\n");
i=j;
for (count=0;count<=10;j++,count++)
printf("%d ", j*j);
printf("\n");
for(count=0;count<=10;count++,i++)
{
k+=(i*i);
}
printf("%d ",k);
system("pause");
return 0;
}
I hope this will help you.