# data[].attributes.body
One of the solution. using ONE array of character. NOT Case sensitive.

# data[].attributes.attachment_link.readable_text
//Filename: palindrome4.cpp
//Declare ayat1 as array of char.
//Receive the input, ayat1.
//Get the length of the input, ayat1.
//Make all the char to lower case
//compare char per char
// first char compare with the last char.
// one pointer move forward
//the other move backward.
// if they are equal, 
// then it is a palindrome.
//it is not case sensitive
// KATAK == katak

#include <iostream>
using namespace std;

#include <cstring>

int main()
{
	//declare them as array of char
	char ayat1[200]; //input
	bool status = true;
	
	//read the input
	cout << "\n Enter ayat: ";
	cin.getline(ayat1, 200, '\n');
		
	//get the length of the input
	int panjang1 = strlen(ayat1);
	cout << "\n panjang = " << panjang1
		<< endl;
		
	strlwr(ayat1); //make all chat to lower case
	cout << "\n ayat1 = " << ayat1
		<< endl;
	
	//compare char per char
	// first char compare with the last char.
	// one pointer move forward
	//the other move backward.
	for (int i=panjang1-1, j=0; 
			i > j ; i--, j++)
	{
		if (ayat1[j] != ayat1[i])
		{
			status = false;
			break;
		}
	}
	
	if (status)
	{
		cout << "\n It is palindrome... "
			<< endl;
	}
	else
	{
		cout << "\n It is not palindrome... "
			<< endl;
	}
	
	return 0;
}


# data[].attributes.body
One of the solution. using ONE array of character. Case sensitive.

# data[].attributes.attachment_link.readable_text
//Filename: palindrome3.cpp
//Declare ayat1 as array of char.
//Receive the input, ayat1.
//Get the length of the input, ayat1.
//compare char per char
// first char compare with the last char.
// one pointer move forward
//the other move backward.
// if they are equal, 
// then it is a palindrome.
// It is case sensitive.
// KATAK != katak

#include <iostream>
using namespace std;

#include <cstring>

int main()
{
	//declare them as array of char
	char ayat1[200]; //input
	bool status = true;
	
	//read the input
	cout << "\n Enter ayat: ";
	cin.getline(ayat1, 200, '\n');
	
	
	//get the length of the input
	int panjang1 = strlen(ayat1);
	cout << "\n the length of ayat1 = " << panjang1
		<< endl;
	
	//compare char per char
	// first char compare with the last char.
	// one pointer move forward
	//the other move backward.
	
	for (int i=panjang1-1, j=0; 
			i > j ; i--, j++)
	{
		if (ayat1[j] != ayat1[i])
		{
			status = false;
			break;
		}
	}
	
	if (status)
	{
		cout << "\n It is palindrome... "
			<< endl;
	}
	else
	{
		cout << "\n It is not palindrome... "
			<< endl;
	}
	
	return 0;
}


# data[].attributes.body
One of the solution. Using TWO arrays of character. Not Case sensitive.

# data[].attributes.attachment_link.readable_text
//Filename: palindrome2.cpp
//Declare ayat1 and ayat2 as array of char.
//Receive the input, ayat1.
//Get the length of the input, ayat1.
//Reverse the input, and store it to ayat2
//Add '\0' at the end of ayat2.
//compare ayat1 and ayat2.
// if they are equal, 
// then they are palindrome.
// It is not case sensitive.
// KATAK == katak

#include <iostream>
using namespace std;

#include <cstring>

int main()
{
	//declare them as array of char
	char ayat1[200]; //input
	char ayat2[200]; 
	
	//read the input
	cout << "\n Enter ayat: ";
	cin.getline(ayat1, 200, '\n');
	
	
	//get the length of the input
	int panjang1 = strlen(ayat1);
	cout << "\n the length of the input = " << panjang1
		<< endl;
	
	//reverse the input store it to ayat2
	for (int i=panjang1-1, j=0; 
			i >= 0 ; i--, j++)
	{
		ayat2[j] = ayat1[i];
	}
	//add '\0' at the end of ayat2
	ayat2[panjang1] = '\0'; 
	//show them:
	cout << "\n ayat1: \n" ;
	cout << ayat1 << endl;
	cout << "\n ayat2: \n" ;
	cout << ayat2 << endl;
	
	//bandingkan ayat1 dengan ayat2
	//it is not case sensitive
	if (strcmp(strlwr(ayat1), strlwr(ayat2))== 0)
	{
		cout << "\n It is palindrome... "
			<< endl;
	}
	else
	{
		cout << "\n It is not palindrome... "
			<< endl;
	}
	
	return 0;
}


# data[].attributes.body
One of the solutions. Using TWO arrays of character. Case sensitive.

# data[].attributes.body
One of the solution

# data[].attributes.attachment_link.readable_text
//File name: freq1.cpp
//valid range of the mark = 0-100.
//declare array of integer for
// frequency of the mark.
//initialize them with Zero.
// ask the user to enter the mark
// or enter character to stop.
// for the valid mark
// freq[mark] increase by one.
// Display the mark, its frequency
// and its horizontal histogram.

#include <iostream>
using namespace std;
int main()
{
		int freq[101] = {0}, mark;
		
		cout << "\n Enter integer number for the mark: ";
		while (cin >> mark)
		{
			cin.ignore(100,'\n');
			//only valid mark
			// shall be proceed.
			if ((mark >= 0) && 
				(mark <=100))
			{
				freq[mark]++;
			}
			cout << "\n Enter character to stop...\n";
			cout << "\n Enter integer number for the mark: ";
		}
	
		cout << endl;
		cout << "Mark" << "\t";
		cout << "Freq" << "\t";
		cout << "Horizontal Histogram" << endl;
		for (int i = 0; i<101; i++)
		{
			if (freq[i] > 0)
				{
					cout << i << "\t";
					cout << freq[i] << "\t";
					for (int j=0; j<freq[i]; j++)
					{
						cout << "*";
					}
					cout << endl;
				}
		}
	
	
	



	return 0;
}
