Define a structure in c++, C/C++ Programming

Assignment Help:

Define a structure in C++:

Write a program a structure in c++ program.

void main()

{

                struct player

                {

                char name[20];

                int age,height;

                }    ;

       struct player p[3];

 

                int i,j,k;

                clrscr();

                for (i=0;i<=2;i++)

                    {

                      printf("Enter the name of player %d ,age %d,height %d\n",i+1,i+1,i+1);

                      scanf("%s %d %d",p[i].name,&p[i].age,&p[i].height);

                    }

                                for (i=0;i<=2;i++)

                    {

                       printf("%s %d %d\n",p[i].name,p[i].age,p[i].height);

                    }

       getch();

}


Related Discussions:- Define a structure in c++

Is there any difficulty with the following : char*a=null; , Is there any di...

Is there any difficulty with the following : char*a=NULL; char& p = *a;? A: The result is indeterminate. You must never do this. A reference has to always refer to some object.

Recursive function, Write a recursive function recursiveMin that takes an i...

Write a recursive function recursiveMin that takes an integer array, a starting subscript and an ending subscript as arguments, and returns the smallest element in the array. The

Programming, what is the first thing I need to know about Programming?

what is the first thing I need to know about Programming?

Array, Assigning value to individual elements in array

Assigning value to individual elements in array

Define the recursion function in c, Define the Recursion Function in C? ...

Define the Recursion Function in C? In C, it is potential for the function to call themselves a function is describing 'recursive' if a statement within the body of a function

Object irientation, Explain about the strategies of implementation of the s...

Explain about the strategies of implementation of the statecharts, Database Management System?

#Luminous Jewels, #Byteland county is very famous for luminous jewels. Lumi...

#Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Ne

Tracing of abstract array - c++ program, Tracing of Abstract array: i...

Tracing of Abstract array: inline int isZero( const Object& o ) {     return o == NOOBJECT; }   int AbstractArray::isEqual( const Object& obj ) const {

Find area under curve, write a c program to find the area under the curve4...

write a c program to find the area under the curve4 f=(x) between x=a and x=l integrate y=(x) between the limits of a and b Solution: #include float    start_point,

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd