# C Programming Code Examples

## C > Beginners Lab Assignments Code Examples

### INTERVIEW QUESTIONS C

C++ Programming Code Check Leap Year -
Program checks whether an year ("integer") entered by the user is a leap year or not. All years which are "perfectly divisible" by 4 are leap years except for century years which is

Concatenate Two Strings strcat() Function -
C program code 'Concatenate 2 strings' using strcat() library function. Logic to concatenate 2 strings in C Programming. Enter first string, enter second string and Concatenate str1 str2

C++ Find Closest Pair of Points in an Array -
Sort array of points according to X coordinate and Y coordinate. Find the distance between two points. And return the 'smallest distance' between 2 points. Find the 'distance' beween

The C++ Language While Loop Statement -
The statements within the while loop would keep on getting executed till the "condition" being tested remains "true". When condition becomes false, the control passes to the first

Find Sum of Natural numbers from 1 to N -
Program find the sum of all natural numbers between 1 to n. Input upper limit to find sum of natural numbers. Store it in some variable say N. Initialize another variable to store sum

Every Possible Combination of two Strings -
Program display 'every possible combination' of two words from the given 2 string without displaying "repeated combinations". Convert string in 2D array. Make the first string words

C++ Language Using the main() Function -
The "main() function" is called when the c++ program starts after initialization of the non-local objects with static storage duration. It's the primary entry point of any C++ Program

C++ Code Finds Greatest Common Divisor -
This means a 'greatest number' which divides both numbers. Example: Two numbers are 18 and 24. Numbers which Divides both are 1, 2, 3 and 6 in which greatest number is 6. So 6 is