ALGORITHM:
STEP 1: Start the program.
STEP 2: Declare the class name as Stat with data member s and member functions.
STEP 3: The constructor Stat() which is used to increment the value of count as 1 to to assign the variable code.
STEP 4: The function showcode() to display the code value.
STEP 5: The function showcount() to display the count value.
STEP 6: Stop the program.
PROGRAM:
#include<iostream.h> |
Output:
Count Objects: 2
Object Number is: 1
Count Objects: 2
Object Number is: 2
0 Response for the "To count the object value using the storage keyword static."
Post a Comment