#include <stdio.h>
#include <conio.h>
void main ()
{
int i, total;
int arr[10];
int *a;
a = arr;
for ( i = 0; i < 10; i++ )
{
printf ( " Enter the number %d: ", i+1 );
scanf ( " %d ", &arr[i] );
}
for ( i = 0; i < 10; i++ )
{
printf ( " %d--- ", *a );
total = total + *a;
a = a + 1;
}
printf ("\nTotal = %d \n",total);
}
OUTPUT:
Enter the number 1: 1
Enter the number 2: 2
Enter the number 3: 3
Enter the number 4: 4
Enter the number 5: 5
Enter the number 6: 6
Enter the number 7: 7
Enter the number 8: 8
Enter the number 9: 9
Enter the number 10: 10
1---2---3---4---5---6---7---8---9---10---
Total = 55
ALSO READ:
-- Program To Understand Working Of Address Concept.
-- Program On Use Of Array & Pointer Concept Together.
-- Program On Pointers & 2 - Dimensional Array.
-- Program On Strings Into Array Of Pointers.
-- Program To Accept & Add Ten Numbers Using Pointers.
-- Program To Implement Minimum Spanning Tree Using Functions, Pointers & Structures.
-- Program To Implement 8 Queens Problem Using Arrays, Pointers & Functions.
-- Program To Implement Quick Sort Using Pointers, Functions & Arrays.
-- Program With Algorithm To Implement Bubble Sort Using Pointers.
-- Program To Implement Recursive Algorithm Using Pointers.
-- Program On Strings Into Array Of Pointers.
-- Program On Pointers & 2 - Dimensional Array.
-- Program On Use Of Array & Pointer Concept Together.
-- Program On Arithmetic Calculations Using Pointers.
-- Program To Add Two Numbers Using Pointers.
-- Program To Accept & Add Ten Numbers Using Pointers.
... Back To C++ Programs Index
... Back To C++ FAQ's Index
... Back To C Programs Index
... Back To C FAQ's Index
... Back To HR Interview Index
Comments
Post a Comment
Please share your opinions and suggestions or your experience in the comments section. This way we can all help each other...
Experienced guys can share their resumes at admin@interview-made-easy.com