मराठी

Write a C++ program to input ‘n’ elements in an one dimensional array and input one another number and check whether this number is present in the array or not.

Advertisements

प्रश्न

Write a C++ program to input ‘n’ elements in an one dimensional array and input one another number and check whether this number is present in the array or not.

कोड लेखन
Advertisements

उत्तर

#include <iostream.h>
main()
{
   int i, n, n1 x(10), p = 0;
   cout "Enter the value of n";
   cin>>in;
   cout<<"/n Input Elements";
   for (i - 1< = ic - n ; i++)
       cin>>x[i];
   cout<<:\n Enter the number to be cheek";
   cin>>h1;
   for (i = 1; i< = n ; i++)
   {
       it (n1 = = x[i])
          P = 1;
   }
       if (P = = 0)
       count<<"\n No is not found";
       else
       cout<<"in No is found";
       return(0);
   }
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2024-2025 (July) Official Board Paper
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×