Program to factorize the given number.

Program to factorize the given number.



int main()
{
int pos_1, pos_2;
char ch;
char input[100];
gets(input); // reading the String
pos_1 = 0; // first position
pos_2 = strlen(input) - 1; // last position

while(pos_1 < pos_2)
{
ch = input[pos_1];
input[pos_1] = input[pos_2];
input[pos_2] = ch;
pos_1++;
pos_2--;
}

printf("%s\n",input);
return 0;
}

No comments:

Post a Comment