C Program To Find Number of Elements In An Array

preview_player
Показать описание

Lets write c program to find number of elements present in an array, where the array size is not mentioned explicitly.

Example: Expected Output
int a[] = {3, 4, 6, 7, 8, 9, 0, 32, 435, 65, 2, 23, 56, 67, 8, 9, 0, 3, 2, 1, 4, 5, 6, 7, 8};

We have 25 no of elements in array.

C Programming Interview / Viva Q&A List

C Programming: Beginner To Advance To Expert
Рекомендации по теме
Комментарии
Автор

I have a question.
Is it possible we allow user to enter the number of elements in a array
And program tells how many numbers user has entered ?
If possible then how? Please let me know.
I don't want to initialise the array, just want to take user input and print how many elements user entered .

historyimperfect
Автор

How to print elements in array when size is not initialized but have elements... For eg - a[ ]={2, it be printf("%d", a[ ]) ;
If I try this way it's not working

dhakshitham