Q. 8 (c):
#include <iostream>
using namespace std;
void funcRec(int u, char v);
int main()
{
funcRec(5,'A');
}
void funcRec(int u, char v)
{
if (u == 0)
cout << v;
else if (u == 1)
cout << static_cast<char>(static_cast<int>(v)+1);
else
funcRec(u-1,v);
}
No comments:
Post a Comment