I need a program to print string like as follow below in the objective c:
PARTHIBAN
ARTHIBA
RTHIB
THI
H
I have tried with (*)
Code:
int i,j,k,height;
NSString *name;
NSLog(@"Enter the name: %@",name);
NSLog(@"Enter the height:");
scanf("%i",&height);
for (i=height;i>=1;i--)
{
for(k=height-1;k>=i;k--)
{
NSLog(@" ");
}
for (j=i; j>=1; j--)
{
NSLog(@"*");
}
}
Can you please help me print the string as mentioned above in Objective-C?