Neeraj Mishra

A crazy computer and programming lover. He spend most of his time in programming, blogging and helping other programming geeks.

Program for Factorial in C

Here you will get program for factorial in C. We can find factorial of any number by multiplying it with all the numbers below it. For example, factorial of 3 will be 6 (3 * 2 * 1). Program for Factorial in C   Output Enter value of n:4 Factorial of 4 is 24

C program to input number of week's day(1-7) and translate to its equivalent name of the day of the week

#include<stdio.h>#include<conio.h> void main(){ int ch; clrscr(); //to clear the screen printf(“Enter number of week’s day(1-7):”); scanf(“%d”,&ch); switch(ch) { case 1: printf(“nSunday”); break; case 2: printf(“nMonday”); break; case 3: printf(“nTuesday”); break; case 4: printf(“nWednesday”); break; case 5: printf(“nThursday”); break; case 6: printf(“nFriday”); break; case 7: printf(“nSaturday”); break; } getch(); //to stop the screen}

C program to find whether a given character is an alphabet,digit or any special character(using ASCII values)

#include<stdio.h>#include<conio.h> void main(){    char ch;    clrscr();    //to clear the screen    printf(“Enter any character:”);    scanf(“%c”,&ch);     if((ch>=’A’&&ch<=’Z’)||(ch>=’a’&&ch<=’z’))        printf(“nYou have entered an alphabet”);    else        if(ch>=’0’&&ch<=’9′)            printf(“nYou have entered a digit”);        else            printf(“nYou have entered a special character”);     getch();    //to stop the screen}

C program to convert temperature from Fahrenheit to Celsius or Celsius to Fahrenheit

#include<stdio.h> #include<conio.h> void main() { double temp,ctemp; int ch; clrscr();    //to clear the screen     printf(“Temprature Converrsion Menu”); printf(“nt1.Fahrenheit to Celsius”); printf(“nt2.Celsius to Fahrenheit”); printf(“nEnter your choice(1/2):”); scanf(“%d”,&ch); if(ch==1) { printf(“Enter Temperature in Fahrenheit:”); scanf(“%lf”,&temp); ctemp=(temp-32)/1.8; printf(“nTemprature in celcius is %lf”,ctemp); } else if(ch==2) { printf(“Enter Temperature in Celsius:”); scanf(“%lf”,&temp); ctemp=(1.8*temp)+32; printf(“nTemperature in Fahrenheit is …

C program to convert temperature from Fahrenheit to Celsius or Celsius to Fahrenheit Read More »