Find GCD and LCM Using C Program

Find GCD and LCM Using C Program

GCD: The greatest common divisor (GCD), which is also known as the greatest common factor (GCF), of two or more integers, is the largest integer that is a common divisor (factor) of all the given integers.

LCM: The least common multiple (LCM), which is also known as the least common denominator (LCD) in fractions, of two or more integers is the smallest integer that is a common multiple (denominator) of all the given integers. Continue reading

C program to check odd or even and check any integer that divisible by another integer value

C program to check odd or even and check any integer that divisible by another integer value

C program to check odd or even: In childhood As you have studied in mathematics that in decimal number system even numbers are divisible by 2 while odd are not divisible by 2, we may use modulus operator(%) which returns remainder, For example, 7%2 gives 1 ( remainder when seven is divided by two). Even numbers are of the form 2*X and odd are of the form (2*X+1) where X is is an integer.We will determine whether a number is odd or even by using different methods all are provided with a code in c language.

Continue reading

C program to perform basic arithmetic addition, subtraction, multiplication and division

C program to perform basic arithmetic addition, subtraction, multiplication and division

C program to perform basic arithmetic operations which are an addition, subtraction, multiplication, and division of two numbers. Numbers are assumed to be integers and will be entered by the user.

Continue reading

C program print integer

Let’s talk about integers. Whole numbers less than zero are called negative integers. The integer zero is neither positive nor negative and has no sign. Two integers are opposites if they are each the same distance away from zero but on opposite sides of the number line. Positive integers can be written with or without a sign. Besides that, an integer without any sign is called Unsigned integer.

The int data type is signed and has a minimum range of at least -32767 through 32767 inclusive. The actual values are given in limits.h as INT_MIN and INT_MAX respectively.

An unsigned int has a minimal range of 0 through 65535 inclusive with the actual maximum value being UINT_MAX from that same header file.

C program print integer

This is a simple c program that takes value from the user and then prints it. Here input is done using scanf() function and print using stranded printf() function. <stdio.h> header file has the definition of scanf and printf function.

Continue reading

Sample C Hello World Program

Sample C hello world program: A program that displays “Hello World” String on screen.This program I used, printf library function is used to display text on the screen, ‘\n’ places the cursor at the beginning of next line, stdio.h header file contains a declaration of printf function. The code will work on all operating systems may be its Linux, Mac or any other and compilers. Continue reading

Setup Turbo C++ / C Compiler for windows

Setup Turbo C++ / C Compiler for windows

Well ! Very worm welcome friends. Today we know how to setup Turbo C++ Compiler for windows. This tutorial gives you easy-to-follow instructions, with screenshots, for setting up a compiler step by step.

Setup Turbo C or C++ compiler step by step:

Step 1: Download Turbo C++

  • Go to this website: https://turboc.codeplex.com/
  • Follow the link to “Download the binary release” (direct link)
  • If any previous “Turbo C++” version install in your computer, then first of all uninstall that.
  •  Extract downloaded “Turbo C++ 3.2.zip” file.

Step 2: Install

Run “setup.exe” file and Follow the setup instructions. Continue reading


Page 5 of 512345