Thursday, February 10, 2011

Verbose Option

 include <stdio.h>
# include <stdlib.h>
int main()
{
    //Using this line we can assign 0 for all the array element.
    int a[10]={};
    //This line declare the array with some garbage value.
    int b[10];
    //This line used to set the first element value as one and remaining all are zero's.
    int c[10]={1};
    int i=0;
    //This for loop used for printing the array element and their index value's.
    for(;i<10;i++)
    {
    printf("Index%d-content=%d\tIndex%d-content=%d\tIndex%d-content=%d\n",i,a[i],i,c[i],i,b[i]);
    }

    return 0;
}




Output:

Index0-content=0    Index0-content=1    Index0-content=-2
Index1-content=0    Index1-content=0    Index1-content=1982242980
Index2-content=0    Index2-content=0    Index2-content=1982310602
Index3-content=0    Index3-content=0    Index3-content=3411632
Index4-content=0    Index4-content=0    Index4-content=3411568
Index5-content=0    Index5-content=0    Index5-content=2293552
Index6-content=0    Index6-content=0    Index6-content=1982310408
Index7-content=0    Index7-content=0    Index7-content=0
Index8-content=0    Index8-content=0    Index8-content=0
Index9-content=0    Index9-content=0    Index9-content=2147315712

No comments:

Post a Comment