Write a program to access an array of integers using pointer

Write a program to access an array of integers using pointer

access array

Output

Enter elements: 1
2
3
5
4
You entered: 1
2
3
5
4

Basic Information of commands in C Program

#include

This is a preprocessor command that includes standard input output header file(stdio.h) from the C library before compiling a C program.

int main()

This is the main function from where execution of any C program begins

{

This indicates the beginning of the main functions

/*comments*/

whatever is given inside the command “/* */” in any C program, won’t be considered for compilation and execution.

printf(“”)

printf commmand print the output on to the screen.

getch();

This command waits for any character intput from keyword


return 0;

This command terminates C program (main function) and returns 0.

}

This indicates the end of the main function.

Learn other topics related to this program

  • Array in C language
  • Pointers in C language
  • You may also like...

    Leave a Reply

    Your email address will not be published. Required fields are marked *