Saved Bookmarks
| 1. |
Write the output of the following C++ code. Also, write the name of feature of Object Oriented Programming used in the following program jointly illustrated by the functions [I] to [IV]:#include<iostream.h>void Line() //Fuction [I]{for(int L=1;L<=80;L++) cout<<"-";cout<<end1;}void Line(int N) //Fuction [II]{ for(int L=1;L<=N;L++) cout<<"*";cout<<end1;}void Line(char C,A,int N) //Fuction [III]{ for(int L=1;L< = N;L++) cout<<C;cout<<end1;}void Line(int M,int N) //Fuction [IV]{for(int L=1;L< = N;L++) cout<<M*L;cout<<end1;}void main(){int A = 9,B = 4,C = 3;char K = '#';Line(K,B);Line(A,C);} |
|
Answer» Output: # # # # 9 18 27 The name of feature of Object Oriented Programming used in the above program jointly illustrated by the functions [I] to [IV] is known as ‘function overloading’. |
|