# C Programming Code Examples

## C > File Operations Code Examples

### C Program to Copy File into Another File

C Calculates Area of an Equilatral Triangle -
An "Equilateral Triangle" has equal sides (all 3 sides are equal). In order to calculate the area of equilateral triangle, we must know the side of the triangle. This C program would prompt

Program Code Demonstrate Nested Printf -
Print to 'abcdefghijklmnopqrstuvwxyz' while executing inner printf. Length of the "abcdfg hijklmnopqrstuvwxyz" is 26. Printf will return Length of String. It returns 26 to outer printf

C++ Code to List Files in Current Directory -
To list and "display/print" all the files present inside the current directory in The C++, use a pointer say dir of DIR and the pointer say pdir of dirent to open and "read directory" to print

Program to Check Whether Graph is DAG -
This is a C++ Program code to check whether graph is DAG. In mathematics and computer science, a directed acyclic graph, is a directed graph with no directed cycles. It is formed by

How to check Sparse Matrix in C language -
C program to read elements in a matrix and check whether matrix is Sparse matrix or not. C code to determining sparse matrix. Sparse matrix is a special matrix with most of its...

C Programs Calculates the Simple Interest -
Program calculates the simple interest given the principal amount, rate of interest & time. The Formula to calculate the Simple interest is: simple_interest = (p * t * r) / 100 where p...

C Code Find Perfect Numbers from 1 to N -
C program find Perfect numbers between 1 to n. Input Upper Limit to find Perfect numbers. Store it in a variable say end. Run a loop from 1 to end, increment 1 in each iteration. The...

C++ Language & One Time Pad Algorithm -
C++ program encodes any message using the technique of 'One time' pad cipher technique. Input is not Case Sensitive and works only for all characters. 'White Spaces' are not ignored