# C Programming Code Examples

## C > C on Unix Code Examples

### Program to get the GroupID ( GID ) information

Checks Leap Year by Conditional Operator -
C Programming Language input a year and check whether year is leap year or not using conditional/ternary operator ?:. How to check leap year using conditional operator in C. If a

Convert Octal to Decimal Number System -
Program to input Octal number and convert to Decimal number. Octal number system is a base 8 number system. Octal number system uses 8 symbols to represent all its numbers...

C++ Performing Edge Coloring of a Graph -
In graph theory, an "edge coloring" of a graph is an assignment of colors to the edges of the graph so that no two adjacent edges have the same color. Any "2 edges" connected to same

C Add two numbers and display their sum -
C program code input two numbers from user and calculate their sum. C program to add 2 numbers and printing their sum as output. How to add two numbers in C programming.

C++ Swap Two Numbers Using 3. Variable -
Swap numbers means exchange the values of two variables with each other. Variable num1 contains 20 and num2 contains 40 after swap there values num1 contains 40 num2 contains

Finding Last Occurrence of Word in String -
Logic to Search 'Last Occurrence' of a word is almost similar to searching first occurrence of a word in string. Just with last occurrence of a word do not terminate loop if first occurrence

C Language Program Implement Cyclesort -
C Program implements 'Cyclesort'. Cycle sort is an in-place, unstable 'Sorting Algorithm', a comparison sort that is theoretically optimal in terms of the total number of writes to the

C++ Programming Encrypt & Decrypt File -
To encrypt & decrypt file content in C++, you have to enter the file name with extension to encrypt & decrypt the content present inside the file. Now open that file using the function