Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes

C Programming Code Examples

C > For Loops and While Loops Code Examples

C Language program print all even numbers from 1 to n using for loop. So first let us talk about the easiest way to print even numbers. If I ask you to list all even numbers from 1 to
C program print all natural numbers from 1 to n using loop. Input upper limit to print natural number from user. Store it in a variable say N. Run a For Loop from 1 to N with 1 increment.
How to print Odd Numbers from 1 to N using loop in C programming. Input upper limit to print odd number from user. Store it in some variable N. Run a loop from 1 to N, increment
C program print all Prime numbers between 1 to n using loop. A Prime number is a positive integer greater than 1 that is only divisible by 1 and itself. For example: 2, 3 , 5, 7, 11 are the
Internally C represent every character using ASCII character code. ASCII is a fixed integer value for each global printable, non-printable characters. For example ASCII value of a=97,
Program print ASCII values of all characters. ASCII stands for American Standard Code for Information Interchange. It is a set of integer values that represents different printable and
C Programming print Fibonacci series up to n terms using loop. Fibonacci series is a series of numbers where the current number is the sum of previous two terms. For Example: 0, 1,
C program to input a number from user and print multiplication table of the given number using for loop. Input a number from user to generate multiplication table. Store it in a var
C Program code print all Natural Numbers in reverse from n to 1 using for loop. Input start limit from user. Store it in some variable say start. Run a loop from start to 1 & decrement
C program to input a number from user and print it into words using for loop. The above logic is correct however it print the words in reverse order. For example, suppose number
C program print pascal triangle up to n rows. Pascal triangle is a triangular number pattern named after famous mathematician Pascal. Where n is row number and k is term of that
Program print Strong numbers between 1 to n. Strong number is a special number whose sum of factorial of digits is equal to original number. For example: 145 is strong number.
C program to input a number from user and swap first and last digit of the given number. Input number from user, find last digit, find total number of digit - 1, find first digit. How
The continue statement is used inside loops. When a continue statement is encountered inside a loop, control jumps to the beginning of the loop for next iteration, skipping the...
Counting is sequence of whole numbers in ascending order without zero. Developing a program of counting in C language is easy and we shall see here in this chapter. Count
The LCM of two integers num1 and num2 is the smallest positive integer that is perfectly divisible by both num1 and num2 (without a remainder). For example: the LCM of 72 and
C Language program to read input until user enters a positive integer. Positive Numbers 1, 2, 3... are known as natural numbers. C code below takes a positive integer (let say n) as...
In C Coding, the string entered by the user is stored in variable str. Then, the user is asked to enter the character whose frequency is to be found. This is stored in variable ch. Now,
C Program for Loop to display the Fibonacci series. Program prompts user for the number of terms and displays the series having the same number of terms. Program ask user to
C Code example of Infinite While Loop. Since the value of the variable var is same (there is no ++ or -- operator used on variable, inside the body of loop) the condition var<=2 will be

Page 1 Page 2 Page 3