# c programming

## How To Get Absolute Number In C

#include<stdio.h> #include<conio.h> void main () { int num; clrscr(); printf(“Enter A number to get it’s absolute Number”); scanf(“%d”,&num); if(num<0) num=-num; printf(“%d”,num); getch(); } After Running Program 🙂

## How To Calculate GST% By Using C

To Calculate GST% by Using  C .  Here are  really simple coding of C. #include<stdio.h> #include<conio.h> #include<math.h> void main () { float original_cost,GST,Netprice,GST_Amount; clrscr(); printf(“Calculate the GST on your product\n”); printf(“Enter Original cost of your product\n”); scanf(“%f”,&original_cost); printf(“Enter the Percent of GST on that product\n”); scanf(“%f”,&GST); GST_Amount=(original_cost*GST)/100; Netprice=original_cost+GST_Amount; printf(“Your Netprice=%f”,Netprice);…

## Finding Ascii value of a char in C

Q. How to find ASCII value in C #include<stdio.h> #include<conio.h> void main () { int a,b; clrscr(); printf(“Enter digit to get it’s character value= “); scanf(“%d”,&a); printf(“The character vlaue is\t%c”,a); getch(); } After Running program 🙂

## Celsius To Fahrenheit And back In C

Q. Changing  Celcius to Fahrenheit And back in C  by simple program. #include<stdio.h> #include<conio.h> void main() { int option; float c,f; clrscr(); printf(“Enter c for celsius to fahrenheit, f for the reverse\n”); option=getch(); switch(option) { case ‘c’: case ‘C’: printf(“Enter value in celsius\n”); scanf(“%f”,&c); f=(c*9)/5 + 32; printf(“%0.2f celsius is…

## Area Of Circle In C

Q. How to Find Area of Circle In C ? #include<stdio.h> #include<conio.h> #include<math.h> void main() { float r,area; clrscr(); printf(“Enter the radius of circle”); scanf(“%f”,&r); area=r*r; area=area*3.14; printf(“%0.2f”,area); getch(); } After Running Program  🙂

## Rounding Of Number In C

Q. How to make program  of Rounding Number in C ? #include<stdio.h> #include<conio.h> void main () { float num; int x; clrscr(); printf(“Enter your Number”); scanf(“%f”,&num); if(num<0) x=(num-0.5); else x=(num + 0.5); printf(“%d”,x); getch(); } After Running Program 🙂

## Sum Of Digits In C

Q. How to make program of Sum Of digit (input-> 1,2,3 output->1+2+3=6) In C #include<stdio.h> #include<conio.h> #include<math.h> void main() { long num; int r,ans=0; clrscr(); printf(“Enter 5 digit Number:->>”); scanf(“%ld”,&num); while(num>0) { r=num%10; num=num/10; ans+=r; } printf(“\nAns=%d”,ans); getch(); } After Running Program 🙂

## Calculating Total and Percent By Using C

#include<stdio.h> #include<conio.h> void main () { float total,math,bio,phy,eng,comp,avg; clrscr(); printf(“Enter the value of your subject,math,bio,phy,eng,comp\n”); scanf(“%f%f%f%f%f”,&math,&bio,&phy,&eng,&comp); total=math+bio+phy+eng+comp; printf(“Your total number=%0.2f\n”,total); avg=total/5; printf(“Your percent=%0.2f %”,avg); getch(); } After Running Program 🙂

## Changing Kilometer into Meter,Centimeter,Inch,Foot,Yard&Mile By using C

#include<stdio.h> #include<conio.h> void main() { float kilometer,meter,centimeter,inch,foot,yard,mile; clrscr(); printf(“Enter your journey in kilometer=”); scanf(“%f”,&kilometer); meter=kilometer*1000; centimeter=100*meter; inch=centimeter/2.54; foot=inch/12; yard=foot/3; mile=yard/1760; printf(“Meter=%0.2f\nCentimeter=%0.2f\n”,meter,centimeter ); printf(“Inch=%0.2f\nFoot=%0.2f\nYard=%0.2f\nMile=%0.2f\n”,inch,foot,yard,mile); getch(); } After Running Program 🙂

## Min,Max,Mid by using C

MIN,MAX,MID by using c