Enter 10 number using arrays and find out minimum number Using Pointer


void main()
{
 int no[10],i,*p;
 clrscr();

 printf("enter 10 no:");
 for(i=0;i<=9;i++)
 {
  scanf("%d",&no[i]);

 }
 p=&no[0];

 for(i=0;i<=9;i++)
 {
  if(*p>no[i])
  {
   *p=no[i];
  }
 }
 printf("\nmini:%d",*p);
 getch();
}
Output:
10
20
30
40
50
60
70
80
90
100

Minimum Number is: 10

Enter 10 number using arrays and find out minimum number Using Pointer Enter 10 number using arrays and find out minimum number Using Pointer Reviewed by Unknown on 7:51:00 PM Rating: 5

No comments:

Powered by Blogger.