C Programming
C Programming

Searching an element in an Array

Searching an element in an Array

 

 

C programming
C programming

Searching an element in an Array

 

 

Question:

Write a program to search a how many number of times a specific number occurs in a given array of 10 elements.

Solution:

 

#include<stdio.h>
int main(){
    int arr[10]={ 1,3,3,4,5,6,7,3,8,3};
    int x,count=0;
    printf(“Enter the number to be search\n”);
    scanf(“%d”,&x);
    for(int i=0;i<=9;i++){
        if(arr[i]==x) count++;
    }
    printf(“Number %d occurs %d times\n”,x,count);
    return 0;
}

Topics Covered :

  • linear programming in c language
  • logical programming in c language
  • linear search in c
  • linear search algorithm
  • logical prograaming in c
  • logical programming in c
  • logical questions in c language
  • c language logical programs
  • linear search,linear programming
  • c logical programming questions
  • logical c programming questions
  • c language logical questions
  • logical c programs
  • c logical questions

 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin 

 

Leave a Reply

Your email address will not be published. Required fields are marked *