Lecture 103
#include <iostream>
#include <conio.h>
using namespace std;
main ()
{
char
name[20]="Shahid Iqbal";
int i,j;
cout<<"Name: ";
i=0;
cout<<endl;
while(name[i] !=
'\0')
{
j=i;
while(j != 0)
{
cout<<" ";
j--;
}
cout<<name[i]<<endl;
i++;
}
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10