E
engartte
Hi all,
Let consider the following solution:
#include <stdio.h>
int main ()
{
int a[10], temp;
int i;
for(i=0; i<10; i++){
a = i+1;
printf("%d ",a);
}
printf("\nType a number:");
scanf("%d", &temp);
if(temp>10);
temp = a[0];
for (i=0;i<temp;i++)
a = a[i+1];
for(i=0; i<10; i++)
printf("%d ",a);
printf("\n");
return 0;
}
Of Course,at the follow-up solution I am looking to response
to the following question:
Declare an array a[10],then read the integers into the elements
of the array from keyboard.but,insert the first element of the array
into thwe position specified by a following integer and print the
contents as follows:
1 2 3 4 5 6 7 8 9 10
4
2 3 4 1 5 6 7 8 9 10
but,my solution is not satisfy the condition.If you know some other
on,please show me.
tanx in advnce
engartte
Let consider the following solution:
#include <stdio.h>
int main ()
{
int a[10], temp;
int i;
for(i=0; i<10; i++){
a = i+1;
printf("%d ",a);
}
printf("\nType a number:");
scanf("%d", &temp);
if(temp>10);
temp = a[0];
for (i=0;i<temp;i++)
a = a[i+1];
for(i=0; i<10; i++)
printf("%d ",a);
printf("\n");
return 0;
}
Of Course,at the follow-up solution I am looking to response
to the following question:
Declare an array a[10],then read the integers into the elements
of the array from keyboard.but,insert the first element of the array
into thwe position specified by a following integer and print the
contents as follows:
1 2 3 4 5 6 7 8 9 10
4
2 3 4 1 5 6 7 8 9 10
but,my solution is not satisfy the condition.If you know some other
on,please show me.
tanx in advnce
engartte