C Program Write a Program to ForEach
Menu
Turn Mobile View Off
by Dinesh Thakur

 

 

#include<stdio.h>

main()
{
  int a[5],i,num;
  clrscr();
  for(i=0;i<=4;i++)
    {
      printf("enter the values of 1st matrix=");
      scanf("%d",&a[i]);
    }
    printf("enter the value you want to search");
    scanf("%d",&num);
      for(i=0;i<=4;i++)
         {
            if(num==a[i])
              {
                 printf("number is present=%d",num);
                 break;
              }
         }
         if(i>4)
         printf("number is not present");
 getch();
}
 
Dinesh Thakur is a Technology Columinist and founder of Computer Notes and Technology Motivation. Turn Mobile View Off