How to make a function that displays all the inputted integers? My function here doesn't display the integers and it always pops up with a message ".exe stopped working" please help. void display(int arr[], int count) { int x; printf("\nDISPLAY ELEMENTS\n"); printf("\nPlease enter number of elements in an array: "); scanf("%d",&count); printf("\nPlease enter %d elements of an array \n", count); for (x=0; x< count; x++) { scanf("%d", &arr[x]); } printf("\n Elemenst in this Array are :\n"); for (x=0; x

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question
How to make a function that displays all the inputted integers?
My function here doesn't display the integers and it always pops up with a message ".exe stopped working",
please help.
void display(int arr[], int count)
{
intx;
printf("\nDISPLAY ELEMENTS\n");
printf("\nPlease enter number of elements in an array: ");
scanf("%d", &count);
printf("\nPlease enter %d elements of an array\n", count);
for (x=0; x<count; x++)
{
scanf("%d", &arr[x]);
}
printf("\n Elemenst in this Array are:\n");
for (x=0; x<count; x++)
{
printf("%d\t", arr[x]);
}
printf("\n");
}
Transcribed Image Text:How to make a function that displays all the inputted integers? My function here doesn't display the integers and it always pops up with a message ".exe stopped working", please help. void display(int arr[], int count) { intx; printf("\nDISPLAY ELEMENTS\n"); printf("\nPlease enter number of elements in an array: "); scanf("%d", &count); printf("\nPlease enter %d elements of an array\n", count); for (x=0; x<count; x++) { scanf("%d", &arr[x]); } printf("\n Elemenst in this Array are:\n"); for (x=0; x<count; x++) { printf("%d\t", arr[x]); } printf("\n"); }
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT