




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Notes for Beginners and made to study within a month
Typology: Study notes
1 / 130
This page cannot be seen from the preview
Don't miss anything!





























































































Adeel M. Syed Adeel M. Syed [email protected] [email protected]
Introduction to Visual Studio .Net
struct dist { int feet; float inches; }; void main( ) { dist d1; cin>>d1.feet; cin>>d1.inches; dist d2 = { 30, }; cout<
Similar to passing variables to functions , one may pass the objects of a structure to a function. Vice Versa, objects can also be returned from a function.
Q1. Create a employee structure. The member data should comprise one integer for storing the employee id, one long integer for storing his salary, and a floating number for storing the employee’s pension. Create two functions, one for entering this data and other to display it. Write a main( ) that allows the user to call these functions.
Write a C++ structure function which converts a sum of money given as an integer number of pence into a floating point value representing the equivalent number of pounds. For example 365 pence would be 3. pounds.
Example: void repchar (char ch=‘x’, int val = 5) ; void main ( ) { repchar( ); repchar( ‘w’ ); \repchar( ‘t’ , 20 ); \repchar( 20 ); getch( ); } void repchar (char ch, int n) { for (int j=0 ; j
Calculation of Area of SQUARE, RECTANGLE and TRIANGLE. func1 ( ): Comparing condition & calling of function mydef( ) mydef( ): multiply all arguments and print result. main( ): calling func1.
Examples: