C Program to Print Environment Variables

This C Program prints environment variables.Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. Here is source code of the C Program to print environment variables. The C program is successfully compiled and run on a Linux system. The program output is also … Read more

advertisement

C Program to Print Multiplication Table

A multiplication table of numbers is created by multiplying a constant integer by a number of repetitions ranging from 1 to 10. Example: If the given input is 6, then the multiplication table is: 6 x 1 = 6 6 x 2 = 12 6 x 3 = 18 6 x 4 = 24 6 … Read more

advertisement

C Program to Print Semicolon without using Semicolon

This is a C Program to print a semicolon without using a semicolon anywhere in the code. Problem Description This program prints a semicolon without using a semicolon anywhere in the code. Problem Solution 1. Print the ASCII value of semicolon and exit. Program/Source Code Here is source code of the C Program to print … Read more

advertisement

C Program to Display its own Source Code as Output

This is a C Program to display its own source code as its output. Problem Description This program displays its own source code as its output. Problem Solution 1. Display the content from the same file you are writing the source code. Program/Source Code Here is source code of the C Program to display its … Read more

advertisement

C Program to Shutdown Computer in Linux

This is a C program to shutdown or turn off the computer in linux. Problem Description This program is used to shutdown or turn off the computer in linux. Problem Solution 1. Use function system(“shutdown -P now”) to shutdown or turn off the computer in linux. 2. Exit. Program/Source Code Here is source code of … Read more

advertisement

C Program to Find Sum of Digits of a Number using Recursion

This is a C program to find sum of digits of a number using recursion. Problem Description This C program finds the sum of digits of a number using recursion. Problem Solution The following C program, using recursion, finds the sum of its digits. Program/Source Code Here is the source code of the C program … Read more

advertisement

C Program to Print Statement without Semicolon

This is a C Program to print any print statement without using semicolon. Problem Description This program prints any print statement without using semicolon. Problem Solution 1. Use the print statement in the if or else condition. Program/Source Code Here is source code of the C Program to print any print statement without using semicolon. … Read more

advertisement

C Program without using the Main() Function

In C, main() function is a user-defined function. The main function acts as the beginning point for program execution. However, we are writing the program without using the main function. To call main, we use macro and token pasting operator instead of main. Problem Description Write a C program without using main function. Problem Solution … Read more

advertisement

C Program to Reverse a Number using Recursion

This is a C program to find reverse of a number using recursion. Problem Description This C program finds the reverse of a number using recursion. Problem Solution The following C program using recursion reverses the digits of the number and displays it on the output of the terminal. Eg: 123 becomes 321. Program/Source Code … Read more

advertisement

C Program to Extract Last Two Digits of a Given Year

This is C Program to extract last two digits of a given year. Problem Description This program takes any year as input and prints its last two digits. Problem Solution 1. Take any year as input. 2. Divide the input by 100 and obtain its remainder. 3. The remainder got is the output. Program/Source Code … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.