C EXAMPLES TUTOR
Pages
HOME
INTRODUCTION
DECISION & LOOP
FUNCTIONS
ARRAY & POINTER
STRING
STRUCTURE & UNION
FILES I/O
HOME
INTRODUCTION
Print "Hello, World!"
Print an integer
Add two integers
Multiply two floating point numbers
Find ASCII value of a character
Compute quotient and remainder
Find the size of int, float, double and char
Demonstrate the working of keyword long
Swap two numbers
DECISION AND LOOP
Check whether a number is even or odd
Check whether a character is vowel or consonant
Find the largest number among three numbers
Find all roots of a quadratic equation
Check leap year
Check whether a number is positive or negative
Check whether a character is an alphabet or not
Calculate the sum of natural numbers
Find factorial of a number
Generate multiplication table
Display Fibonacci sequence
Find GCD of two numbers
Find LCM of two numbers
Display characters from A to Z using loop
Count number of digits in an integer
Reverse a number
Calculate the power of a number
Check whether a number is palindrome or not
Check whether a number is prime or not
Display prime numbers between two intervals
Check Armstrong number
Display Armstrong number between two intervals
Display factors of a number
Make a simple calculator using switch...case
FUNCTIONS
ARRAY AND POINTER
Display prime numbers between intervals using function
Check prime or Armstrong number using user-defined function
Check whether a number can be expressed as sum of two prime numbers
Find the sum of natural numbers using recursion
Find factorial of a number using recursion
Find G.C.D Using recursion
Convert binary number to decimal and vice-versa
Convert octal number to decimal and vice-versa
Convert binary number to octal and vice-versa
Reverse a sentence using recursion
Calculate the power using recursion
Calculate average using arrays
Find largest element of an array
Calculate standard deviation
Add two matrix using multi- dimensional arrays
Multiply to matrix using multi- dimensional arrays
Find transpose of a matrix
Multiply two matrices by passing matrix to a function
Access elements of an array using pointer
Swap numbers in cyclic order using call by reference
Find largest number using dynamic memory allocation
STRINGS
STRUCTURE AND UNION
Find the frequency of characters in a string
Count the number of vowels, consonants and so on
Remove all characters in a string except alphabet
Find the length of a string
Concatenate two strings
Copy string without using strcpy()
Sort elements in lexicographical Order
Store information (name, roll and marks) of a student using structure
Add two distances (in inch-feet) system using structures
Add two complex numbers by passing structure to a function
Calculate difference between two time periods
Store information of students using structure
Store information using structures with dynamically memory allocation
FILES I/O
Write a sentence to a file
Read a line from a file and display it
Display its own source code as output
Home
Subscribe to:
Posts (Atom)