Discover answers to your most pressing questions at Westonci.ca, the ultimate Q&A platform that connects you with expert solutions. Discover detailed solutions to your questions from a wide network of experts on our comprehensive Q&A platform. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.
Sagot :
Answer:
Following are the code to the given question:
#include<stdio.h>//include header file
int main() //defining a main method
{
int a[100],k,x,s; //defining integer variable and an array
printf("Input the number of element want to insert array: "); //print message
scanf("%d",&x); //input value
printf("Enter array value: \n"); //print message
for(k = 0; k<x; k++) //defining a loop that inputs values
{
scanf("%d",&a[k]); //use array to input value
}
s = a[0]; //holding first array value in array
for(k=0;k<x;k++) //use for loop
{
if(a[k]<s) //use if block to check the smallest array value
{
s=a[k];//holding smallest array value
}
}
printf("smallest number= %d",s);//print smallest value
}
Output:
Please find the attached file.
Explanation:
In this code an array and another integer variable "a[100], i,n, and s" is is declared, in which the array and n for input the value from the user-end.
In the next step, an "s" variable is declared that inputs the first array element value in s and use a loop to check the smallest array element and prints its value.

Thank you for choosing our service. We're dedicated to providing the best answers for all your questions. Visit us again. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. We're glad you chose Westonci.ca. Revisit us for updated answers from our knowledgeable team.