Nothing Special   »   [go: up one dir, main page]

C Questions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 40

1.

C us supported by the following operating system:


A. Unix
B. Linux
C. Windows
D. All of above
2. C is the ____________ language:
A. Low level
B. High Level
C. Both Low and High Level
D. None of these
3. C has ____________ keywords:
A. 30
B. 31
C. 32
D. 33
4. Which is not the fundamental data types?
A. Char
B. Array
C. Int
D. Float
5. Variable is a:
A. Location in memory
B. Location in CPU Registers
C. Both
D. None of these
6. int can store _______________
A. Real numbers
B. Characters
C. String
D. None of these
7. The Arithmetic operator '%' can be used with:
A. int
B. float
C. double
D. void
8. Which is the symbol for AND operator:
A. ||
B. &&
C. $$
D. None of these
9. C program starts executing from:
A. main()
B. header file
C. both
D. None of these
10. Which is the incorrect statement:
A. Variable name can contain underscore.
B. Variable name may start from digit.
C. Variable name may not have white space character.
D. Keyword cannot be a variable name.
11. String is:
A. Array of numbers.
B. Array of characters.
C. Both
D. None of these.
12. Which statement is wrong:
A. A function may have arguments.
B. A function may return value.
C. A can be invoked many times in a single program.
D. Function cannot be reused

13. A function can return only ____________


A. Single value
B. Two Values.
C. Many values.
D. None of these
14. Mathematical function are stored in ____________ header file:
A. stdio.h
B. conio.h
C. math.h
D. string.h
15. An array can be declared:
A. Statically
B. Dynamically
C. Both
D. None of these
16. An array is ____________ data-structure:
A. Linear
B. Non-linear
C. Hierarchical
D. None of these
17. Which term is not related to function:
A. Prototype
B. Definition
C. Call
D. Recipient
18. A pointer variable can store ____________.
A. Constant value
B. Value of anther variable.
C. Address of another variable
D. None of these.

19. Which is the incorrect function prototype:


A. int add(int,int);
B. int add(float, int);
C. float add(int,int);
D. float add(float,int);
20. Which is the type of files:
A. Text
B. Binary
C. Both
D. None of these
21. Which function is not related to file handling:
A. fopen();
B. fclose();
C. fprintf();
D. printf()
22. A structured programming have:
A. Sequence
B. Selection
C. Iteration
D. All of Above
23. Which is not the selective control flow statement:
A. while
B. if
C. Switch-case
D. if-else
24. Who is the manufacturer of C language:
A. Herbert Schieldt
B. Banjarne Stroups
C. Dennis Ritchie
D. None of these
25. __________ is used to break out of a program?

a) break
b) continue
c) terminate
d) exit
Q26. Functions with the same name and different parameters represents :
a) function overloading
b) function overriding
c) recursion
d) None of the mentioned
Q27 Can we declare a function inside the structure of C?
a) YES
b) NO
c) Both of them
d) None of them
28.What will happen if in a C program you assign a value to an array element whose
subscript exceeds the size of array?
A. The element will be set to 0.
B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.
29. long int factorial (long x)
{
????
return x * factorial(x – 1);
}
With what do you replace the ???? to make the function shown above return the correct
answer?
A. if (x == 0) return 0;
B. return 1;
C. if (x >= 2) return 2;
D. if (x <= 1) return 1;

30. C programs are converted into machine language with the help of
A. An Editor
B. A compiler
C. An operating system
D. None of the above
31. In switch statement, each case instance value must be _______?
A. Constant
B. Variable
C. Special Symbol
D. None of the avobe

32) Choose a correct statement about C structures.


A) Structure elements can be initialized at the time of declaration.
B) Structure members cannot be initialized at the time of declaration
C) Only integer members of structure can be initialized at the time of declaraion
D) None of the above

33) Choose a correct statement about C structure.?


int main()
{
struct ship
{

};
return 0;
}

A) It is wrong to define an empty structure


B) Member variables can be added to a structure even after its first definition.
C) There is no use of defining an empty structure
D) None of the above

34. What is the output of C program with structures.?


int main()
{
struct tree
{
int h;
int w;
};
struct tree tree1={10};
printf("%d ",tree1.w);
printf("%d",tree1.h);
return 0;
}
Output:
A) 0 0
B) 10 0
C) 0 10
D) 10 10

35. What is the output of C program.?


int main()
{
struct laptop
{
int cost;
char brand[10];
};
struct laptop L1={5000,"ACER"};
struct laptop L2={6000,"IBM"};
printf("Name=%s",L1.brand);
return 0;
}
Output:
A) ACER
B) IBM
C) Compiler error
D) None of the above

36. What is the output of C program with structure arrays.?


int main ()
{
struct pens
{
int color;
}p1[2];
struct pens p2[3];
p1[0].color=5;
p1[1].color=9;
printf("%d ",p1[0].color);
printf("%d",p1[1].color);
return 0;
}
Output:
A) 5 5
B) 5 9
C) 9 5
D) Compiler error

34. Determine the output of the C code mentioned below:


#include <stdio.h>
int main()
{
float q = ‘a’;
printf(“%f”, q);
return 0;
}

a. run time error


b. a
c. 97.000000
d. a.0000000

35. Which of these is NOT a relational or logical operator?


a. =
b. ||
c. ==
d. !=
36. Out of the following, which one is not valid as an if-else statement?
a. if ((char) x){}
b. if (x){}
c. if (func1 (x)){}
d. if (if (x == 1)){}

37. We cannot use the keyword ‘break’ simply within _________.


a. while
b. for
c. if-else
d. do-while

38. The output of the C code mentioned below would be:


#include <stdio.h>
int main()
{
int a = 0, b = 0;
while (a < 2)
{
a++;
while (b < 3)
{
printf(“find\n”);
goto l1;
}
}
}
a. loop loop find loop
b. Infinite error
c. find loop
d. Compile time loop

39. The global variables are ____________.


a. External
b. Internal
c. Both External and Internal
d. None of the above

40. Out of the following operations, which one is not possible in the case of a register
variable?
a. Global declaration of the register variable
b. Copying the value from the memory variable
c. Reading any value into the register variable
d. All of the above

41. The correct format of declaring a function is:


a. type_of_return name_of_function (argument type);
b. type_of_return name_of_function (argument type){}
c. type_of_return (argument type) name_of_function;
d. all of the above
1. Write a program to test if a number is Armstrong number
2. Write a program to calculate roots of quadratic equation.
3. Write a program to check whether character is a vowel or consonant using switch case.
4. Write a program to implement simple calculator using switch case.
5. Write a program to find reverse a number.
6. Write a program to find sum of digits of a given number
7.WAP to define a structure to maintain the record of cricket team.
8. WAP to find simple and compound interest using function.
9. WAP to find the count the total number above average and below average.
10. WAP to find a nCr and nPr of a number using function.
11. Explain the Looping statements with syntax and suitable examples.
12. List the advantages of function. Explain function prototype(declaration), function call and
function definition using syntax and example.
13. WAP to find a factorial of a number using function.
14. WAP to find the maximum number from an array of n elements.
15. WAP to find GCD and LCM of any two numbers
16. WAP to define a structure to maintain the record of n employees.

1. All of above.
2. Both Low and High Level.
3. 32.
4. Array.
5. Location in memory.
6. Characters.
7. int.
8. &&.
9. main().
10. Variable name may start from digit.
11. Array of characters.
12. Function cannot be reused.
13. Single value.
14. math.h.
15. Both.
16. Linear.
17. Recipient.
18. Address of another variable.
19. int add(float, int).
20. Both.
21. printf().
22. All of Above.
23. if-else.
24. Dennis Ritchie.
25. c) terminate.
26. a) function overloading.
27. b) NO.
28. C. The program may crash if some important data gets overwritten.
29. B. return 1;
30. B. A compiler.
31. A. Constant.
32. A) Structure elements can be initialized at the time of declaration.
33. A) It is wrong to define an empty structure.
34. B) 10 0.
35. A) ACER.
36. B) 5 9.
37. d. do-while.
38. b. Infinite error.
39. a. External.
40. a. Global declaration of the register variable.
41. a. type_of_return name_of_function (argument type);
6D
9B
23 A
25 A
31 B
33 C
34 C
36 D
34 C
37 C
39 C
40 D
C++
1. What is a pure virtual function in C++?

a) A function that has a body

b) A function that is declared but not defined

c) A function that is declared with the 'pure' keyword

d) A function that is declared with the 'virtual' keyword

2. Which of the following is true about templates in C++?

a) Templates are instantiated at runtime

b) Templates are instantiated at compile time

c) Templates cannot be used with classes

d) Templates cannot be used with functions

3. Which type of inheritance allows a class to inherit from multiple base classes?

a) Single inheritance

b) Multiple inheritance

c) Hierarchical inheritance

d) Multilevel inheritance

4. What is the primary difference between a class template and a function template in C++?

a) Class templates can have static members

b) Function templates can have private members

c) Class templates can have multiple instantiations

d) Function templates can have default arguments

5. Which keyword is used to declare a constant member function in C++?

a) const

b) static

c) final

d) readonly
6. Which of the following is true about encapsulation in C++?

a) It allows data hiding and abstraction

b) It allows data sharing between classes

c) It allows access to private members from outside the class

d) It allows inheritance between classes

7. Which keyword is used to prevent a class from being inherited in C++?

a) final

b) sealed

c) const

d) static

8. Which keyword is used to define a template in C++?

a) template

b) generic

c) class

d) typedef

9. In C++, function overloading is an example of:

a) Inheritance

b) Encapsulation

c) Polymorphism

d) Abstraction

10. What is polymorphism in C++?

a) Ability to represent the same object in multiple forms

b) Ability to define multiple constructors in a class

c) Ability to define multiple functions with the same name but different arguments

d) Ability to create objects of different types

11. What is the purpose of a constructor in C++?


a) To initialize the object of a class

b) To destroy the object of a class

c) To perform calculations

d) To define member functions

12. Which of the following is a valid constructor in C++?

a) class MyClass() {}

b) MyClass() {}

c) constructor MyClass() {}

d) void constructor() {}

13. What is a class in C++?

a) A function

b) A data type

c) A loop

d) A variable

14. In C++, inheritance is a feature that allows:

a) A class to inherit from multiple classes

b) A class to inherit only from one class

c) A class to inherit from built-in types only

d) A class to inherit from itself

15. Which of the following is true about function overloading in C++?

a) Only one function can have the same name

b) Functions must have different names

c) Functions must have different return types

d) Functions must have the same number of arguments but different types

16. Which operator is used to access members of a class in C++?

a) .
b) ::

c) ->

d) :

17. Which keyword is used to denote inheritance in C++?

a) inherit

b) extends

c) inherits

d) :

18. Which access specifier allows members to be accessible only within the same class and its
derived classes?

a) public

b) private

c) protected

d) global

19. Which of the following is true about abstract classes in C++?

a) They cannot have member variables

b) They cannot have member functions

c) They cannot be instantiated

d) They cannot be inherited

20. Which of the following correctly defines a template function in C++?

a) template <typename T> void functionName(T arg) {}

b) template void functionName<T>(T arg) {}

c) void functionName<T> template(T arg) {}

d) void functionName(template <T> arg) {}

21What keyword is used to define a class in C++?

a) class
b) define

c) struct

d) object

22 Which of the following is true about objects in C++?

a) Objects are instances of classes

b) Objects cannot have member functions

c) Objects cannot have member variables

d) Objects are declared using the 'object' keyword

23. which keyword is used to declare a static member in a C++ class?

a) static

b) public

c) private

d) protected

24. Static members are shared among:

a) Different objects of the same class

b) Different classes

c) All objects of a program

d) None of the above

25. In C++, inheritance is a feature that allows:

a) A class to inherit from multiple classes

b) A class to inherit only from one class

c) A class to inherit from built-in types only

d) A class to inherit from itself

26. What is a template in C++?

a) A blueprint for creating objects

b) A function that takes variable number of arguments


c) A class that can operate with generic types

d) A predefined data structure

27. What is the purpose of a destructor in C++?

a) To initialize an object

b) To free resources when an object goes out of scope

c) To copy an object

d) To define member functions

28. Which of the following is NOT a type of inheritance supported by C++?

a) Single inheritance

b) Multiple inheritance

c) Hierarchical inheritance

d) Circular inheritance

29. In C++, function overloading is an example of:

a) Inheritance

b) Encapsulation

c) Polymorphism

d) Abstraction

30. What is polymorphism in C++?

a) Ability to represent the same object in multiple forms

b) Ability to define multiple constructors in a class

c) Ability to define multiple functions with the same name but different arguments

d) Ability to create objects of different types

31. What does the keyword 'virtual' do in C++?

a) It declares a function as pure virtual

b) It specifies that a function may be overridden in derived classes

c) It specifies that a function cannot be overridden in derived classes


d) It specifies that a function is static

32. Which operator is used to access members of a class in C++?

a) .

b) ::

c) ->

d) :

33. Which of the following is true about static member functions in C++?

a) They can access only static members of a class

b) They can access only non-static members of a class

c) They cannot access any members of a class

d) They can access both static and non-static members of a class

34. Which of the following statements about constructors is false?

a) Constructors cannot return values

b) Constructors have the same name as the class

c) Constructors can be overloaded

d) Constructors can be inherited

35. Which of the following is not a type of polymorphism in C++?

a) Compile-time polymorphism

b) Run-time polymorphism

c) Operator overloading

d) Encapsulation

36. Which operator is used to access members of a class in C++?

a) .

b) ::

c) ->
37. Which keyword is used to denote inheritance in C++?

a) inherit

b) extends

c) inherits

d) :

38. Which of the following correctly defines a template function in C++?

a) template <typename T> void functionName(T arg) {}

b) template void functionName<T>(T arg) {}

c) void functionName<T> template(T arg) {}

d) void functionName(template <T> arg) {}

39. What is the purpose of a copy constructor in C++?

a) To create a copy of an existing object

b) To initialize an object

c) To delete an object

d) To move an object

40. Which of the following is true about abstract classes in C++?

a) They cannot have member variables

b) They cannot have member functions

c) They cannot be instantiated

d) They cannot be inherited


Descriptive Questions (Long questions)
1 List and explain the different type of constructors.

Default Constructor:

A default constructor is a constructor that takes no arguments.

It is automatically called when an object is created without providing any initial values.

If a class does not define any constructor, the compiler provides a default constructor.

Parameterized Constructor:

A parameterized constructor takes one or more parameters.

It allows you to initialize the object's state with specific values when the object is created.

Copy Constructor:

A copy constructor creates a new object as a copy of an existing object.

It takes a reference to an object of the same class as a parameter.

The copy constructor is used when objects are passed by value, returned by value, or explicitly when
creating a new object.

Destructor:

A destructor is called when an object goes out of scope or is explicitly deleted.

It is responsible for releasing resources acquired by the object.

A class can only have one destructor, and its name is the class name preceded by a tilde (~).
2 Differentiate between C and C++.

C:

Is a mid language (can be considered as high and low)

Follows steps and procedures.

Manual memory management

Not object-oriented.

No support for function overloading

Limited exception handling

Uses printf and scanf for input/output.

C++:

Is a high level language

Also Supports steps and procedures, but also objects.

Manual memory management with extra features like constructors and destructors.

object-oriented features like classes, inheritance, and polymorphism.

Improved exception handling with try, catch, and throw.

Integrate the use of <iostream> for input/output with cin and cout.

Summary :
C is a language positioned between high and low-level languages, maintaining a versatile stance. On
the other hand, C++ is firmly categorized as a high-level language.

C primarily adheres to procedural steps, providing a straightforward approach to programming. In


contrast, C++ not only supports procedural programming but also introduces robust object-oriented
concepts such as classes, inheritance, and polymorphism.

Manual memory management is a characteristic feature of C, requiring programmers to allocate and


deallocate memory explicitly. Conversely, C++ enhances manual memory management through
features like constructors and destructors, providing additional control and organization.

C lacks built-in support for object-oriented features, function overloading, and has limited
capabilities in exception handling. In contrast, C++ embraces a comprehensive object-oriented
paradigm, supporting features like classes, inheritance, polymorphism, function overloading, and
robust exception handling using try, catch, and throw.

Input/output operations in C are accomplished using functions like printf and scanf. In contrast, C++
modernizes these operations by integrating the <iostream> library, introducing convenient tools like
cin and cout for streamlined input/output.

In summary, while C bridges the gap between high and low levels with procedural simplicity, C++
stands as a high-level language that enriches programming with advanced features and modern
conveniences.
3 Write object-oriented program to read and display record of an employee.

#include <iostream>

#include <conio.h>

class Employee

private:

char name[100];

int employeeId;

double salary;

public:

void inputDetails()

cout << "Enter Employee Name: ";

cin >> name;

cout << "Enter Employee ID: ";

cin >> employeeId;

cout << "Enter Employee Salary: ";

cin >> salary;

void displayDetails()

cout << "\nEmployee Details:\n";

cout << "Name: " << name << "\n";

cout << "Employee ID: " << employeeId << "\n";

cout << "Salary: " << salary << "\n";

};
void main()

clrscr();

Employee employee;

employee.inputDetails();

employee.displayDetails();

getch();

}
4 Write object-oriented program to calculate volume of cylinder.

#include <iostream>

#include <conio.h>

class Cylinder

private:

float radius;

float height;

public:

void inputDimensions() {

cout << "Enter the radius of the cylinder: ";

cin >> radius;

cout << "Enter the height of the cylinder: ";

cin >> height;

void calculateVolume()

float volume = 3.14159 * radius * radius * height;

cout << "\nCylinder Volume: " << volume << " cubic units\n";

};

void main() {

clrscr();

Cylinder cylinder;

cylinder.inputDimensions();

cylinder.calculateVolume();

getch();

}
5 Explain the types of inheritance with suitable example.

6 Explain Virtual function with suitable example.


7 Explain the concept of template using suitable program

include <iostream>

#include <conio.h>

template <typename T>

T add(T num1, T num2)

return num1 + num2;

void main()

{ clrscr();

int resultInt = add(5, 7);

cout << "Sum of integers: " << resultInt << endl;

float resultFloat = add(3.5, 2.5);

cout << "Sum of floating-point numbers: " << resultFloat << endl;

getch();

clrscr();

‘add’ function is a template function that can add two numbers of any data type (int, float, etc.).
This allows you to use the same function for different data types, promoting code reusability and
simplicity.
8 Develop simple banking application using object-oriented approach with following functions.

Createaccount()

Deposit()

Withdraw()

Calculateinterest()

Checkbalance()

#include <iostream>

#include <conio.h>

class BankAccount

{private:

string accountHolderName;

int balance;

int interestRate;

public:

void createAccount()

{ cout << "Enter Account Holder's Name: ";

cin >> accountHolderName;

cout << "Enter Initial Balance: ";

cin >> balance;

cout << "Enter Annual Interest Rate (%): ";

cin >> interestRate;

void deposit()

{ int amount;

cout << "Enter Deposit Amount: ";

cin >> amount;

balance += amount;

cout << "Deposit Successful. Updated Balance: $" << balance << endl;
}

void withdraw()

{ int amount;

cout << "Enter Withdrawal Amount: ";

cin >> amount;

if (amount > balance)

{ cout << "Insufficient Funds! Withdrawal Failed.\n";

else

{ balance -= amount;

cout << "Withdrawal Successful. Updated Balance: $" << balance << endl;

void calculateInterest()

{ int interest = (interestRate / 100) * balance;

balance += interest;

cout << "Interest Calculated. Updated Balance: $" << balance << endl;

void checkBalance()

{ cout << "Account Holder: " << accountHolderName << endl;

cout << "Current Balance: $" << balance << endl;

};

void main()

{ clrscr();

BankAccount account;

int choice;

do

{ cout << "\n1. Create Account\n2. Deposit\n3. Withdraw\n4. Calculate Interest\n5. Check
Balance\n6. Exit\n";

cout << "Enter your choice: ";


cin >> choice;

switch (choice)

{ case 1:

account.createAccount();

break;

case 2:

account.deposit();

break;

case 3:

account.withdraw();

break;

case 4:

account.calculateInterest();

break;

case 5:

account.checkBalance();

break;

case 6:

cout << "Exiting the application.\n";

break;

default:

cout << "Invalid Choice. Please try again.\n";

while (choice != 6);

getch();

}
9. Write object-oriented program to add two complex numbers.

#include <iostream>

#include <conio.h>

class ComplexNumber

{private:

float real;

float imaginary;

public:

void input()

{ cout << "Enter real part: ";

cin >> real;

cout << "Enter imaginary part: ";

cin >> imaginary;

void add(ComplexNumber num)

{ real += num.real;

imaginary += num.imaginary;

void display()

{ cout << "\nSum of Complex Numbers: " << real << " + " << imaginary << "i\n";

};

void main()

{ clrscr();

ComplexNumber num1, num2;

cout << "Enter Complex Number 1:\n";

num1.input();

cout << "\nEnter Complex Number 2:\n";

num2.input();
num1.add(num2);

num1.display();

getch();

}
10. List and explain the features and advantages of Object-oriented Programming language

Features:

Classes and Objects:

Classes: Represent templates or blueprints for creating objects.

Objects: Instances of classes, encapsulating data and behavior.

Encapsulation:

Bundling of data and methods that operate on that data into a single unit (class).

Hides the internal details of an object and restricts access to certain components.

Inheritance:

A mechanism for creating a new class (derived or child class) that inherits properties and behaviors
from an existing class (base or parent class).

Supports code reuse and promotes the creation of a hierarchy of classes.

Polymorphism:

The ability of objects of different classes to be treated as objects of a common base class.

Allows a single interface to represent various types of objects.

Abstraction:

Simplifying complex systems by modeling classes based on the essential properties and behaviors
they share.

Reduces code complexity and focuses on relevant details.

Advantages:

Modularity:

Breaks down large systems into smaller, manageable modules (classes).

Each module can be developed, tested, and maintained independently.

Code Reusability:

Inheritance allows the reuse of code from existing classes.

Reduces redundancy and promotes the creation of efficient and maintainable code.

Flexibility and Extensibility:

Easy to modify and extend existing code.

New classes can be added with minimal impact on the existing codebase.

Maintenance:

Changes to one part of the code don't affect other parts, leading to easier maintenance.
Encapsulation helps in localizing potential issues.

Readability:

Improved code readability due to the organization of code into classes and objects.

Promotes understanding of the code's structure and relationships.

Efficient Problem Solving:

Closer alignment with real-world problem-solving models.

Encourages the development of solutions that mirror the problem domain.

Security:

Encapsulation protects the internal state of objects, making it more difficult for external entities to
interfere.

Adaptability:

Easier to adapt to changing requirements or new features.

Supports a more iterative and evolutionary development approach.

Parallel Development:

Multiple developers can work on different classes concurrently.

Enhances team collaboration and productivity.

Scalability:

Well-suited for building large, complex systems.


11. Explain Static members with the help of suitable example.

12 Explain Virtual function with suitable example.

13 Write object-oriented program to add two complex numbers.


14. Write object-oriented program to calculate factorial of a number.

#include <iostream>

#include <conio.h>

class FactorialCalculator

private:

int number;

int result;

public:

void inputNumber()

{ std::cout << "Enter a number: ";

std::cin >> number;

void calculateFactorial()

{ result = 1;

for (int i = 1; i <= number; ++i)

{ result *= i;

void displayResult()

{ std::cout << "\nFactorial of " << number << ": " << result << "\n";

};

void main()

clrscr();

FactorialCalculator calculator;

calculator.inputNumber();

calculator.calculateFactorial();

calculator.displayResult();
getch();}

15. WAP to implement the following inheritance

#include <iostream>

#include <conio.h>

class Player

protected:

string name;

int matches;

public:
void inputDetails()

{ cout << "Enter Player Name: ";

cin >> name;

cout << "Enter Number of Matches: ";

cin >> matches;

};

class Batsman : public Player

{private:

int totalScore;

float averageScore;

public:

void inputBatsmanDetails()

{ inputDetails();

cout << "Enter Total Score: ";

cin >> totalScore;

averageScore = totalScore / 1.0;

void displayBatsmanDetails()

{ cout << "\nBatsman Details:\n";

cout << "Name: " << name << "\n";

cout << "Matches Played: " << matches << "\n";

cout << "Total Score: " << totalScore << "\n";

cout << "Average Score: " << averageScore << "\n";

};

class Bowler : public Player

{private:

int noOfWickets;

public:
void inputBowlerDetails()

{ inputDetails();

cout << "Enter Number of Wickets: ";

cin >> noOfWickets;

void displayBowlerDetails()

{ cout << "\nBowler Details:\n";

cout << "Name: " << name << "\n";

cout << "Matches Played: " << matches << "\n";

cout << "Number of Wickets: " << noOfWickets << "\n";

};

void main()

{ clrscr();

Batsman batsman;

Bowler bowler;

cout << "Enter Batsman Details:\n";

batsman.inputBatsmanDetails();

batsman.displayBatsmanDetails();

cout << "\nEnter Bowler Details:\n";

bowler.inputBowlerDetails();

bowler.displayBowlerDetails();

getch();

You might also like