0

Make me understand this code

This is type and no of argument based code https://code.sololearn.com/co5gjhdkxJOL/?ref=app #include <iostream> #include<iomanip> using namespace std; void display(char); void display(int); void display(char, int); void display(int,int); int main() { char ch = 'a'; int inum= 25, n= 7; cout<<"character function"<<endl; display (ch); cout <<"integer function"<<endl; display (n); cout <<"char & int function"<<endl; display ('*',inum); cout<<"int int fnctn"<<endl; display (inum ,n); system("Pause"); return 0; } void display (char character) { for(int i=0; i<5;i++) cout <<setw(2)<<character; cout<<endl; } void display (char character , int n) { for(int i=0; i<5;i++) cout <<setw(2)<<character; cout<<endl; } void display (int num) { for(int i=0; i<5;i++) cout <<setw(4)<<num*(i+1); cout<<endl; } void display (int num , int n) { for(int i=0; i<5;i++) cout <<setw(3)<<num*(i+1); cout<<endl; }

28th Feb 2022, 8:14 AM
Ashwin
Ashwin - avatar
1 Answer
+ 1
This code uses prototype function, every function should be fully decleared before using it, or using the prototype then declear it below.
28th Feb 2022, 9:24 AM
Mohammed