Input some numbers in an array. Print the array using pointer.
#include <stdio.h>
#include <conio.h>
void print ( int arr[], int l)
{
int i;
for ( i = 0; i < l; i++ )
{
printf("%d, ",*(arr+i));
}
}
void main ( )
{
int arr[10], i;
clrscr ( );
for ( i = 0; i < 10; i++ )
{
printf("\n\t\t\t Enter a number..:"); scanf("%d",&arr[i]);
}
printf("\n\n\t The array is..:");
print ( arr, 10 );
getch ( );
}
Click here to contact us
#include <stdio.h>
#include <conio.h>
void print ( int arr[], int l)
{
int i;
for ( i = 0; i < l; i++ )
{
printf("%d, ",*(arr+i));
}
}
void main ( )
{
int arr[10], i;
clrscr ( );
for ( i = 0; i < 10; i++ )
{
printf("\n\t\t\t Enter a number..:"); scanf("%d",&arr[i]);
}
printf("\n\n\t The array is..:");
print ( arr, 10 );
getch ( );
}
Click here to contact us
No comments:
Post a Comment