1. Home
  2. /
  3. C
  4. /
  5. Palindrome Check

Palindrome Check - C Typing CST Test

Loading…

Palindrome Check — C Code

Checks if a number reads the same forwards and backwards. Uses digit extraction and reversal.

#include <stdio.h>

int main() {
	int n = 121, orig = n, rev = 0;

	while (n != 0) {
		rev = rev * 10 + n % 10;

		n /= 10;

	}

	if (orig == rev)

		printf("Palindrome\n");

	else

		printf("Not Palindrome\n");

	return 0;

}

C Language Guide

C is a general-purpose, procedural programming language that provides low-level access to memory, efficient performance, and a foundation for system and application software development.

Primary Use Cases

  • ▸Operating system kernels (e.g., Linux, Windows)
  • ▸Embedded systems and microcontrollers
  • ▸Device drivers and hardware interfaces
  • ▸Compilers, interpreters, and runtime systems
  • ▸High-performance computing and real-time applications

Notable Features

  • ▸Low-level memory access with pointers
  • ▸Procedural programming with structured code
  • ▸Efficient and fast execution
  • ▸Standard libraries for I/O, string, and math operations
  • ▸Portability across platforms via ANSI C standard

Origin & Creator

Created by Dennis Ritchie at Bell Labs in 1972, originally for developing the UNIX operating system.

Industrial Note

C is essential in embedded systems, OS kernels, compilers, device drivers, and performance-critical applications where low-level memory control and speed are required.

More C Typing Exercises

Hello World in CSum of First N NumbersFactorial of a NumberCheck Even or OddReverse a NumberFind Largest of Three NumbersSwap Two NumbersFibonacci SeriesPrime Number CheckPrint Personal InformationStructure of C ProgramSyntax Error Example

Practice Other Languages

ReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypherGremlin