Write a program of function with parameter and but not return value


 

/* Write a program of function with  parameter and but not return value. */

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

void fun1(char,int);

fun1(‘a’,3);

fun1(‘b’,2);

fun1(‘c’,1);

getch();

}

void fun1(char ch,int n)

{

for(int i=1;i<=n;i++)

cout<<ch;

cout<<“\n”;

}

output:

aaa

bb

c

Related Posts

Comments are closed.