Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
One Dimensional in Arrays of Programming in C
1842 Views
One Dimensional 
If set of values stored in one variable by one index or subscript, which is called as single dimensional or one dimensional array.
Program
#include
void main(){
    //Allocates memory for 0 to 2 index
    int numbers[5];
    int i;
    //Reading five values
    for (i=0;i<5;i++){
    printf("Enter %d value:",(i+1));
    scanf("%d",&numbers[i]);
    }
    //Displaying numbers array values
    for (i=0;i<5;i++)
    printf("%d - %d\n",i,numbers[i]);
}
Output 
Enter 1 value: 10
Enter 2 value: 20
Enter 3 value: 30
Enter 4 value: 40
Enter 5 value: 50

0 - 10
1 - 20
2 - 30
3 - 40
4 - 50
Next Topics
Next lessons of current book.
Previous Topics
Previous lessons of current book.
Looping Statements of Programming in C
Looping Statements of Programming in C
Looping Statements of Programming in C
Looping Statements of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details