#include<iostream> #include<string> using namespace std; class fanct{ public: void repchar(string ch, int n){ for(int j=0; j<n;j++){ cout<<ch; cout<<endl; } } }; int main(){ fanct call; call.repchar("Johny Singh",10); return 0; }
Output
Description:
In this program we are just passing argument to the function. we are just taking two types of data type one String and other Integer type data. we have a loop which will print the string data type until what we have pass the value of integer in the main function by passing argument through function calling.
Hello, I'm Mutabar Shah, an IT professional passionate about writing on programming and new tech trends. With six years of experience, I take pride in delivering top-quality services regarding web and app services to my clients and meeting their specific requirements.
No comments: