# c

## 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 🙂

## 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  🙂

## Reverse Number By Using C

#include<stdio.h> #include<conio.h> void main () { int num,rev=0,rem; clrscr(); printf(“Enter the Number=”); scanf(“%d”,&num); while(num!=0) { rem=num%10; rev=rev*10+rem; num=num/10; } if(num==0) printf( ” Reverse Number is=%d”,rev); getch(); } After Running Program 🙂

## Simple and compound interest by using SWITCH in C

#include<stdio.h> #include<conio.h> #include<math.h> void main() { int p,r,t,option; float result; clrscr(); printf(“PRINCIPAL, TIME & RATE\n”); scanf(“%d%d%d”,&p,&t,&r); printf(“Enter 1 for SI, 2 for CI\n”); scanf(“%d”,&option); switch(option) { case 1:result=(p*t*r)/100.0; break; case 2:result=p*pow(1+r/100.0,t)-p; break; } printf(“Interest=%f”,result); getch(); } After Running Program- 🙂

## Simple Interest Compound interest by using C

#include<stdio.h> #include<conio.h> #include<math.h> void main() { int p,t; float r,si,ci; clrscr(); printf(“enter the value\n principle\n time\n rate\n”); scanf(“%d%d%f”,&p,&t,&r); /*formula of the simple interest and compound interest*/ si=p*r*t/100.0; ci=p*pow(1+r/100.0,t)-p; printf(“Simple interest=%0.1f\n”,si); printf(“compound interest=%0.1f”,ci); getch(); } After running program-

## Checking property of triangle with C

#include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf(“insurt the value of side a,b,c”); scanf(“%d%d%d”,&a,&b,&c); (a==b&&b==c)?printf(“Equilateral”):(a==b || b==c || a==c)?printf(“Isoceles”):printf(“Scalene”); getch(); } After running the program 🙂

## Check for Leap Year using C

Check for a leap year using a C program