In this post, we will see a C program to convert temperature from Celsius(°C) to Fahrenheit(°F) The program accepts the temperature value in °C  from user and convert its value equivalent to °F and display the result on the screen. Step 1: Start Step 2: Read the temperature value in Celcuis Step… Continue Reading C PROGRAM TO CONVERT TEMPERATURE (CELSIUS TO FAHRENHEIT)

In this article we will see how to compile a C Program with Visual Studio Command Prompt. Here i am using Visual studio 2010. For opening Visual Studio command prompt, All Programs -> Microsoft visual Studio 2010 -> Visual Studio Tools -> Visual Studio command prompt   After opening command… Continue Reading Compiling a C program with Visual Studio Command Prompt

 

C PROGRAM TO ADD TWO NUMBERS / INTEGERS USING FUNCTION

  Sample Output :

C PROGRAM TO FIND LARGEST / BIGGEST NUMBER IN ARRAY

Explanation : The above program is to find the largest element in the given array of elements. Here we are using declaring the maximum size of array as 25 using #define directive . Sample Output :

C PROGRAM TO CHECK WHETHER GIVEN YEAR IS LEAP YEAR OR NOT

  Sample Output :

C PROGRAM TO FIND ROOTS OF QUADRATIC EQUATION

C PROGRAM EXAMPLE FOR toupper() FUNCTION :

 

C PROGRAM EXAMPLE FOR tolower() FUNCTION

 

C PROGRAM TO PERFORM ARITHMETIC OPERATIONS USING SWITCH LOOP :

 

Sample Output:

Before you go through this post go for the link to know about % operator. -> As % operator cannot used with DOUBLE values, as it generates compile time error, there is a special function ” fmod( ) ” in c. -> fmod( ) return type is double. So, we… Continue Reading How to perform Modulus / Mod operator on double values (OR) FMOD( ) function in C Programming

Syntax of Simple if-else —————————— if(condition) { statement1; statement2; . . . statement n; } else { statement1; statement2; . . . statement n; } Program:

Output: Explanation: In the above program, if statements are executed if the condition is true. otherwise else statements are executed. And else statements are… Continue Reading C Program to implement Simple if else

Syntax of Simple-if —————————- if(condition) { statement1; statement2; . . . statement n; } Simple C Program to understand Simple if:

output: Explanation: In the above program, the control enters into the if block only if the condition is true. And the statement printf(“\n program ends \n\n”); is executed… Continue Reading C Program to implement Simple if statement

C PROGRAM TO IMPLEMENT QUEUE OPERATIONS USING ARRAY   original post link: http://cprogramsblog.blogspot.in/2012/11/c-program-to-implement-queue-operations.html #include<stdio.h> #include<conio.h> #define MAX 10 int queue[MAX], front = –1, rear = –1; void Insert_Element(); void Delete_Element(); void Display_Queue(); void Empty_Queue();   int main() { int option; printf(“>>> c program to implement queue operations <<<“); do { printf(“\n\n 1.Insert an element”); printf(“\n 2.Delete an element”); printf(“\n 3.Display queue”); printf(“\n 4.Empty queue”); printf(“\n 5.Exit”); printf(“\n Enter your choice:… Continue Reading C PROGRAM TO IMPLEMENT QUEUE OPERATIONS USING ARRAY

/*program for implementing Stack Operations*/ #include<stdio.h> #include<conio.h> int stack[10],top=-1; //global declaration void push();  //declaring functions void pop(); void display(); void main() { int ch; printf(“>>> StackOperations <<<\n\n“); do { printf(“\n 1.Push”); printf(“\n 2.Pop”); printf(“\n 3.Display”); printf(“\n 4.Exit”); printf(“\n Enter your choice: “); scanf(“%d”,&ch); if(ch==1) push(); else if(ch==2) pop(); else if(ch==3)… Continue Reading C PROGRAM TO IMPLEMENT STACK OPERATIONS