C Program To Search A Number And Count Its Occurrence In An Array

  Рет қаралды 34,998

Technotip

Technotip

Күн бұрын

technotip.com/9062/c-program-...
Twenty-five numbers are entered from the keyboard into an array. The number to be searched is entered through the keyboard by the user. Write a C program to find if the number to be searched is present in the array and if it is present, display the number of times it appears in the array.
Example: Expected Output
Enter 5 integer numbers
1
5
6
3
5
Enter the number to be searched …
5
5 has appeared at position 2 in the array.
5 has appeared at position 5 in the array.
Final Result: 5 has appeared 2 times in the array.
C Programming Interview / Viva Q&A List
technotip.com/6378/c-programm...
C Programming: Beginner To Advance To Expert
technotip.com/6086/c-programm...
Join this channel to get access to perks:
/ @technotipdotorg

Пікірлер: 20
@naboulsikhalid7763
@naboulsikhalid7763 Жыл бұрын
you made it so easy to understand, that a quality. Thank you
@katienefoasoro1132
@katienefoasoro1132 3 жыл бұрын
Great Job! Easy to understand though!
@hey_people4290
@hey_people4290 Жыл бұрын
Thanks!
@zntu6529
@zntu6529 3 жыл бұрын
bro pls make a video on (array of pointer to string) concept its very confusing
@technotipDOTorg
@technotipDOTorg 3 жыл бұрын
Sure will cover it while teaching "Strings". Meanwhile you can watch this video technotip.com/9116/c-programming-arrays-pointers-functions/ and learn how arrays and pointers work. Please don't forget to subscribe to our KZbin channel and blog. 👍
@nischay9385
@nischay9385 11 ай бұрын
Thanks man it really helped me bro❤
@technotipDOTorg
@technotipDOTorg 11 ай бұрын
Happy to know that.
@farihaera4248
@farihaera4248 3 жыл бұрын
I tried this code but the statement prints several times... why?
@LucaSilva04
@LucaSilva04 3 жыл бұрын
I don't understand why you used the scanf of the interger key underneath that printf
@amansayer4943
@amansayer4943 Жыл бұрын
Without scanf how can you give the input
@priyabhardwaj7799
@priyabhardwaj7799 3 жыл бұрын
Why i +1 in printf
@Sanju-gp4ch
@Sanju-gp4ch Жыл бұрын
Because he want to find the position of the number he searched in the array. It can be written as just i only but as we don't start our count from zero so he increased i by one to know the position.
@nizamsakil587
@nizamsakil587 2 жыл бұрын
nice
@zntu6529
@zntu6529 3 жыл бұрын
Write a program to reverse the strings stored in the following array of pointers to strings: char *s[ ] = { "To err is human...", "But to really mess things up...", "One needs to know C!!" } ; pls make a video on explaining this problem pls pls
@technotipDOTorg
@technotipDOTorg 3 жыл бұрын
Will surely take this up when teaching about "Strings" bro. Kindly stay subscribed to our KZbin channel and blog. 👍
@softprince4799
@softprince4799 3 жыл бұрын
please explain this //=========C program to print the all index of an element in an array=========== int AllIndexesRecursive (int input[], int size, int x, int output[]) { if (size == 0) return 0; int smallAns = AllIndexesRecursive (input + 1, size - 1, x, output); if (input[0] == x) { for (int i = smallAns - 1; i >= 0; i--) output[i + 1] = output[i] + 1; output[0] = 0; smallAns++; } else for (int i = smallAns - 1; i >= 0; i--) output[i] = output[i] + 1; return smallAns; } void aio (int a[], int size, int x) { int res[size]; int n = AllIndexesRecursive (a, size, x, res); for (int i = 0; i < n; i++) { printf ("%d ", res[i]); } } void main () { int a[5] = { 1, 2, 1, 1, 1 }; aio (a, 5, 1); return; }
@saidi4988
@saidi4988 Жыл бұрын
Good but video is not clear enough
@kennethluigiregino3877
@kennethluigiregino3877 Жыл бұрын
why is the final result not working for me? for(i=0; i
@amansayer4943
@amansayer4943 Жыл бұрын
Count should be used in if statement not in else statement
Find The Most Frequent Value In An Array | C Programming Example
9:44
Portfolio Courses
Рет қаралды 10 М.
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 39 МЛН
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 44 МЛН
C Program To Count Each Digit In A Number using Arrays
10:11
Technotip
Рет қаралды 7 М.
reverse of a number in c|c program to print reverse of a number
11:18
Sudhakar Atchala
Рет қаралды 89 М.
C Program To Check Repetition of Digit In A Number using Arrays
11:17
Why Do Bubbles Form In Glasses Of Water?
12:33
Joe Scott
Рет қаралды 117 М.
C Program To Find Factorial of a Number using Recursion
10:24
Technotip
Рет қаралды 42 М.
String In Char Array VS. Pointer To String Literal | C Programming Tutorial
9:58
Count the Occurrences of a Value in an Array | C Programming Example
10:26