Question

In: Computer Science

create an array with a bunch of animal

create an array with a bunch of animal

Solutions

Expert Solution

lets see the answer :-

lets see a c program to create a bunch of animal using array

#include<stdio.h>

struct animal {
                char name[100];
                
               };
int main( )
{
        int i,n;
        printf("Enter how many animal records u want to store :: ");
        scanf("%d",&n);
        struct animal stuarr[n];
        printf("Enter name of animal :: \n");

        for(i=0; i<n; i++)
        {
                printf("\nEnter %dst animal record :: \n",i+1);

                printf("Enter Animal Name :: ");
                scanf("%s",stuarr[i].name);
               
        }
        printf("\n\tArray of animal\t\n");
        for(i=0; i<n; i++)
                printf("\t%s\n", stuarr[i].name);

                return 0;
}

output:


Related Solutions

5. Find the generating function for the number of ways to create a bunch of n...
5. Find the generating function for the number of ways to create a bunch of n balloons selected from white, gold, and blue balloons so that the bunch contains at least one white balloon, at least one gold balloon, and at most two blue balloons. How many ways are there to create a bunch of 10 balloons subject to these requirements?
In java: -Create a class named Animal
In java: -Create a class named Animal
JAVASCRIPT: Please create an array of student names and another array of student grades. - Create...
JAVASCRIPT: Please create an array of student names and another array of student grades. - Create a function that can put a name and a grade to the arrays. - Keep Read student name and grade until student name is “???”. And save the reading by using a function - Create another function to show all the grade in that object. - Create the third function that can display the maximum grade and the student’s name. - Create a sorting...
Animal class Create a simple class called Animal instantiated with a name and a method toString...
Animal class Create a simple class called Animal instantiated with a name and a method toString which returns the name. Cat class Create a simple class Cat which extends Animal, but adds no new instance variable or methods. RedCat class Create a simple class RedCat which extends Cat, but adds no new instance variable or methods. WildCardTester class Create a class with the main method and methods addCat, deleteCat and printAll as follows. addCat method Has two parameters, an ArrayList...
<HTML JAVASCRIPT> Please create an array of student names and another array of student grades. Create...
<HTML JAVASCRIPT> Please create an array of student names and another array of student grades. Create a function that can put a name and a grade to the arrays. Keep Read student name and grade until student name is “???”. And save the reading by using a function Create another function to show all the grade in that object. Create the third function that can display the maximum grade and the student’s name. Create a sorting function that can sort...
[JAVA SCRIPT] Please create an array of student names and another array of student grades. Create...
[JAVA SCRIPT] Please create an array of student names and another array of student grades. Create a function that can put a name and a grade to the arrays. Keep Read student name and grade until student name is “???”. And save the reading by using a function Create another function to show all the grade in that object. Create the third function that can display the maximum grade and the student’s name. Create a sorting function that can sort...
Create a rock paper scissors game against the computer using bunch of methods. -No two dimensional...
Create a rock paper scissors game against the computer using bunch of methods. -No two dimensional arrays -No java.util.random -No ragged arrays -Methods only, and one dimensional arrays
In C create an array of 4 integers. Assign a pointer to the array. Use the...
In C create an array of 4 integers. Assign a pointer to the array. Use the pointer to find the average value of the elements in the array and display the results on the screen.
The goal is to Create an array of struct “employee” Fill the array with information read...
The goal is to Create an array of struct “employee” Fill the array with information read from standard input using C++ style I/O Shuffle the array Select 5 employees from the shuffled array Sort the shuffled array of employees by the alphabetical order of their last Name Print this array using C++ style I/O Random Number Seeding We will make use of the random_shuffle() function from the standard algorithm library. You can use srand() function provided in with a seed...
1. A case of 14 bunch broccoli is purchased $16.75. What is the cost per bunch?...
1. A case of 14 bunch broccoli is purchased $16.75. What is the cost per bunch? 2. A case of green beans has 6, #10 cans per case and cost $23.28 per case. What is the cost per can? 3. A case of 6, #10 cans of green beans cost 23.28 per case. The chef has a vegetable soup recipe that calls for 1lb 4 ounces of green beans for a soup recipe. Each can has 46 ounces of drained...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT