int n, number, triangularNumber;
printf("what triangular number do you want?\n")
scanf("%i", &number);
triangularNumber = 0;
for( n=1; n<=number; n++ ){
triangularNumber += n;
}
NSLog(@"Triangular Number %i is %i\n", number, triangularNumber);
int number, right_digit;
NSLog(@"Enter your number :");
scanf("%i", &number);
while (number != 0) {
right_digit = number%10;
NSLog(@"%i",right_digit);
number /= 10;
}
int number, right_digit;
NSLog(@"Enter your number.");
scanf("%i", &number);
do{
right_digit = number%10;
NSLog(@"%i", right_digit);
number /= 10;
}while( number != 0 );