Wednesday, April 22, 2020

One dimensional array in C




  • Flowchart :


  • Syntax :

 datatype array_name[size];
  • Program :

#include<stdio.h>
#include<conio.h>
void main()
{
    int arr[5], i;
    clrscr();
    printf("\n----------------1D ARRAY----------------");
    for(i = 0; i < 5; i++)
    {
        printf("Enter a[%d]: ", i);
        scanf("%d", &arr[i]);
    }

    printf("\nPrinting elements of the array: \n\n");

    for(i = 0; i < 5; i++)
    {
        printf("%d ", arr[i]);
    }

 
    getch();
}



  • Output :


No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...