Static data members of a class occupy memory once whereas non static data members occupy members as per the number of objects created. Justify the statement by writing a program.
Write a program which displays a given character, n number of times, using a function. When the n value is not provided, it should print the given character 80 times. When both the character and n value is not provided, it should print ‘*’ character 80 times.
By using default arguments
Static data members of a class occupy memory once whereas non static data members occupy members as per the number of objects created. Justify the statement by writing a program.
WAP which displays a given character, n number of times, using a function. When the n value is not provided, it should print the given character 80 times. When both the character and n value is not provided, it should print *’character 80 times. [Write the above program in two ways:- -using function overloading. -using default arguments.]