Posts

Showing posts with the label Basic program

Program to see ASCII symbol by entering number in C-language

Program to see ASCII symbol by entering number in C-language #include<stdio.h> int main() { char i;     printf("Enter any number\n");     scanf("%d",&i);     printf("ASCII symbol=%c ",i); } OUTPUT Enter any number 123 ASCII symbol={ By using this program you can see symbol and ASCII  value . This small program further implement to see all ASCII Value  if you want see all ASCII the  Click If you like this program then you can share it and for any issues you can direct contact with me from  Home Page . For regular updates you can also follow my site. Visit Homepage

Program to swapping two value by using third variable and without using thirdin c-language

  Program to swapping two value by using third variable and without using thirdin c-language                        Method-1 #include<stdio.h> int main() {     int a,b,c;     printf("Enter two values a\n");     scanf("%d",&a);     printf("Enter two values b\n");     scanf("%d",&b);       c=a;     a=b;     b=c;     printf("Swapping values\na=%d\nb=%d",a,b); }                           Method-2 #include<stdio.h> int main() { int a,b,c; printf("Enter two values a\n"); scanf("%d",&a); printf("Enter two values b\n"); scanf("%d",&b); a=a+b; b=a-b; a=a-b; printf("Swapping values\na=%d\nb=%d",a,b); } OUTPUT Enter the values a 5 Enter the values b 8 Swapping values a=8 This program is simple program of ...

Program to find real roots of quadreatic equation in C-language

Program to find real roots of quadreatic equation in C-language #include<stdio.h> #include<math.h> int main() {     float a,b,c,X,Y;     printf("Only for real roots\n"); printf("Enter the value of coefficient x^2\n"); scanf("%f",&a);   printf("Enter the value of coefficient x\n");   scanf("%f",&b);   printf("Enter the value of constant\n");     scanf("%f",&c);     X=(-b+(sqrt((b*b)-(4*a*c))))/(2*a);     Y=(-b-(sqrt((b*b)-(4*a*c))))/(2*a);     printf("Roots are \nx=%f \ny=%f",X,Y); } OUTPUT Only for real roots Enter the value of coefficient x^2 1 Enter the value of coefficient x 4 Enter the value of constant 4 Roots are x=-2 y=-2 This program help you to find roots of quardetic equation and this program is perfect example of sqrt function. If you like this program then you can share it and for any issues you can direct contact with me from Home Page. ...

Program to calculate distance between two points

Program to calculate distance between two points #include<stdio.h> #include<math.h> int main() {     float x1,x2,y1,y2,D;     printf("Enter the point x1,x2\n");     scanf("%f%f",&x1,&x2);     printf("Enter the value of y1,y2\n");     scanf("%f%f",&y1,&y2);    D=sqrt(pow((x2-x1),2)+pow((y2-y1),2));   printf("Distance betweent two points=%f",D); } OUTPUT Enter the point x1,x2 4 2 Enter the value of y1,y2 5 1 Distance between two points=4.472136 this program is best example  of combination of sqrt and pow function In this program we use these function for calculating distance between two points. If you like this program then you can share it and for any issues you can direct contact with me from  Home Page. For regular updates you can also follow my site.

Program to find square root of any number

Program to find square root of any number #include<stdio.h> #include<math.h> int main() {     float a,s;     printf("Enter the number\n");     scanf("%f",&a);     s=sqrt(a);     printf("Square root of the number=%f",s); } OUTPUT Enter the number 9 Square root of the number=3.000000 In this program we calculate only square root of any number by using sqrt function. The main use of this function is in calculating roots of quardetic equation. If you like this program then you can share it and for any issues you can direct contact with me from  Home Page. For regular updates you can also follow my site.

Program to find power of any number in c-language

Program to find power of any number in c-language #include<stdio.h> #include<math.h> int main() {     int a,b,p;     printf("Enter base number\n");     scanf("%d",&a);     printf("Enter power\n");     scanf("%d",&b);     p=pow(a,b);     printf("Power of the number =%d",p); } OUTPUT Enter base number 2 Enter power 3 Power of the number=8 This program is perfect example of pow function and also describe the math.h header files. By using this function you can find any power of any number. If you like this program then you can share it and for any issues you can direct contact with me from  Home Page. For regular updates you can also follow my site.

Program to print the cube of a number in c-language

  Program to print the cube of a number in c-language                            Method-1                  #include<stdio.h> main() { int x,y; printf("Enter the number for cube\n"); scanf("%d",&x); y=(x*x*x); printf ("Cube of the number is=%d",y); }                          Method-2                     #include<stdio.h> #include<math.h> main() { int x,y; printf("Enter the number for cube\n"); scanf("%d",&x); y=pow(x,3); printf ("Cube of the number is=%d",y); } OUTPUT Enter the number for cube 5 Cube of the number=125 This program is perfect example of pow function and also describe the math.h header files. By using this function you can find any power of any number. But in this program it is...

Program to print the square of a number in c-language

Program to print the square of a number in c-language                                                          Method-1 #include<stdio.h> int main() { int x,y; printf("Enter the number for square\n"); scanf("%d",&x); y=(x*x); printf ("Square of the number is=%d",y); }                         Method-2  #include<stdio.h> #include<math.h> main() { int x,y; printf("Enter the number for square\n"); scanf("%d",&x); y=pow(x,2); printf ("Square of the number is=%d",y); } OUTPUT Enter the number for square 5 Square of the number=25 This program is perfect example of pow function and also describe the math.h header files. By using this function you can find any power of any number. But in this program...

Program to print compound interest in c-language

Program to print compound interest in c-language #include<stdio.h> #include<math.h> int main() {     float CI,p,r,t;     printf("Enter principle value\n");     scanf("%f",&p);     printf("Enter rate value\n");     scanf("%f",&r);     printf("Enter time\n");     scanf("%f",&t);     CI=p*pow((1+(r/100)),t)-p;     printf("Compound interest=%f",CI);  } OUTPUT Enter principle value 500 Enter rate value 3 Enter time 5 Compound interest=79.636955 This program give you a good knowledge about pow function and math.h header file. And also implementation of complex formula. If you like this program then you can share it and for any issues you can direct contact with me from Home Page. For regular updates you can also follow my site.

Program to print the Simple interest in c-language

Program to print the Simple interest in c-language #include<stdio.h> int main() { float p,r,t,s; printf("Enter principle value\n"); scanf("%f",&p); printf("Enter rate of interest \n"); scanf("%f",&r); printf("Enter time \n"); scanf("%f",&t); s=(p*r*t)/100; printf("Simple Interest=%f",s); } OUTPUT Enter principle value 100 Enter rate of interest 2.5 Enter time 4 Simple Interest=10.000000 From above program you got the basis idea of formula implementation ,and also you aware to float data type. If you like this program then you can share it and for any issues you can direct contact with me from Home Page. For regular updates you can also follow my site.

Program to print area of Tringle in c- language

Program to print area of Tringle in c- language #include<stdio.h> int main() { float area,base,height; printf("Enter base \n"); scanf("%f",&base); printf("Enter height \n"); scanf("%f",&height); area=0.5*base*height; printf("Area of triangle=%f",area); } OUTPUT Enter base 3 Enter height 4 Area of triangle=6.000000 This program is just provide you a way for solve difficult program coming soon.After solving this problem you can apply all the formula for area related to triangle or other. If you like this program then you can share it and for any issues you can direct contact with me from Home Page. For regular updates you can also follow my site.

Program to print the area of circle in C-language

Program to print the area of circle in C-language  #include<stdio.h> int main() { float area,r; printf("Enter radius of circle\n"); scanf("%f",&r); area=3.14*r*r; printf("Area of circle=%f",area); } OUTPUT Enter radius of circle 3 Area of circle=28.260000 This give you knowledge of float data type. And this program is perfect example for implementation of formula using this program you can make all program based upon formula. If you like this program then you can share it and for any issues you can direct contact with me from Home Page. For regular updates you can also follow my site.

Program to print the area of square in c- language

Program to print the area of square in c- language #include<stdio.h> int main() {  float area,a;  printf("Enter side of square\n");  scanf("%f",&a);  area=(a*a);  printf("Area of square=%f",area); } OUTPUT Enter side of square 5 Area of square=25.000000 This program is similar to program like,area of Rectangle.These program help you to build up your knowledge and basic . If you like this program then you can share it and for any issues you can direct contact with me from Home Page. For regular updates you can also follow my site.

Program to print area of Rectangle in c- language

Program to print area of Rectangle in c- language #include<stdio.h> int main() {  float area,h,w;  printf("Enter height of rectangle\n");  scanf("%f",&h);  printf("Enter width of rectangle\n");  scanf("%f",&w);  area=h*w;  printf("Area of rectangle=%f",area); } OUTPUT Enter height of rectangle  5 Enter width of rectangle 3 Area of rectangle=15.000000 Area of Rectangle is   further step toward going advance problem program of C-language.After reading this program you will be able to find  area of rectangle. If you like this program then you can share it and for any issues you can direct contact with me from  Home Page . For regular updates you can also follow my site.

Division of two numbers in C-language

Division of two numbers in C-language #include<stdio.h> int main() { float x,y,z; printf ("Enter two numbers"); scanf("%f%f",&x,&y); z=x/y; printf("Division of two numbers are=%f",z); } OUTPUT Enter two numbers 20 5 Division of two numbers are=4.000000 Division  of two number is simple program of C-language.After reading this program you will be able to form simple mathematics  division . If you like this program then you can share it and for any issues you can direct contact with me from  Home Page . For regular updates you can also follow my site.

Subtraction of two numbers in c- language

Subtraction of two numbers in c- language #include<stdio.h> int main() { int x,y,z; printf ("Enter two numbers"); scanf("%d%d",&x,&y); z=x-y; printf("Subtraction of two numbers are=%d",z); } OUTPUT Enter two numbers 9 5 Subtraction of two numbers are=4 Subtraction  of two number is simple program of C-language.After reading this program you will be able to form simple mathematics  subtraction . If you like this program then you can share it and for any issues you can direct contact with me from  Home Page . For regular updates you can also follow my site.

Multiplication of two numbers in c- language

Multiplication of two numbers in c- language #include<stdio.h> int main() { int x,y,z; printf ("Enter two numbers"); scanf("%d%d",&x,&y); z=x*y; printf("Multiplication of two numbers are=%d",z); } OUTPUT Enter two numbers 8 7 Multiplication of two numbers are=56 Multiplication  of two number is simple program of C-language.After reading this program you will be able to form simple mathematics  multiplication . If you like this program then you can share it and for any issues you can direct contact with me from  Home Page . For regular updates you can also follow my site.                                                                  Next=>

Addition of two numbers in c language

Addition of two numbers in c language #include<stdio.h> int main() { int x,y,z; printf ("Enter two numbers"); scanf("%d%d",&x,&y); z=x+y; printf("Sum of two numbers are=%d",z); } OUTPUT Enter two numbers 4 5 Sum of two numbers are=9 Addition  of two number is simple program of C-language.After reading this program you will be able to form simple mathematics addition . If you like this program then you can share it and for any issues you can direct contact with me from  Home Page . For regular updates you can also follow my site.                                                                 Next=>

Simple Hello world program in c- language

Simple Hello world program in c- language. #include<stdio.h> int main() { printf("Hello world"); } OUTPUT Hello world Hello world  is basic program of  C-language, from Hello world  coding of C-language start. In this program you will be able to print anything like name,text number. If you like this program then you can share it and for any issues you can direct contact with me from Home Page . For regular updates you can also follow my site.

Popular posts

Creative pattern of butterfly in C-language

Syntax of C-language

Introduction of C-language.

Language Translator of C-language

Variable & Datatype for C-programming

Errors in C-language

Linear search in C-language

Addition of two numbers in c language

Program to find the sum of two array into the third in C-language

Program to show present time and date in C-language