Back To C++ User Defined Functions Index
//program to create a function that display hello world for a specified number of times #include
#include
void display(int); void display(int n) { int i; for(i=1;i<=n;i++) { cout<<"hello world\n"; } } void main() { int n; clrscr(); cout<<"enter the number of times you want to display message hello world"; cin>>n; display(n); getch(); }