One dimensional Array_1.1

#include <stdio.h>
int main(void)
{
    int i,a[100],k=9;
    for(i=1;i<=9;i++)
    {
       a[i]=k;
       k--;
    }
    
    for(i=1;i<=9;i++)
    {
       printf("%2d",a[i]);
    }
    printf("\n");
    system("pause");
    return 0;
}


This is the output:
 9 8 7 6 5 4 3 2 1

0 comments:

Post a Comment