Using function, write a complete program that prints your name 10 times
Object: Using function, write a complete program that prints your name 10 times. The Function can take no arguments and should not return any value. C++ projects for beginners with source code
Code:
#include<iostream>
#include<conio.h>
using namespace std;
void nam();
void main()
{
cout<<“\n\t:Print Name 10 Times:\n\n”;
nam();
getch();
}
void nam()
{
int i;
for(i=1;i<=10;i++)
{
cout<<i<<“. “<<“Sean\n”;
}
}
#include<iostream> #include<conio.h> using namespace std; void nam(); void main() { cout<<"\n\t:Print Name 10 Times:\n\n"; nam(); getch(); } void nam() { int i; for(i=1;i<=10;i++) { cout<<i<<". "<<"Sean\n"; } }
Pingback: C++ projects for beginners with source code - Codeboks