Posts

Showing posts from October, 2021

C Program To Convert Temperature In Fahrenheit To Celsius

Image
  C Program To Convert Temperature In Fahrenheit To Celsius /* Author --> HARSH PATEL */ #include<stdio.h> void main() { float cl,fh=20; cl=(fh-32) / 1.8; printf("Temperature in Celsius is %f and Fahrenhit is %f",cl,fh); } output Temperature in Celsius is -6.666667 and Fahrenhit is 20.000000   •now  the program ends without any error .

C Program To Compute Volume And Surface Area Of A Sphere

Image
   C Program To Compute Volume And Surface Area Of A Sphere /* Author --> HARSH PATE L */ #include<stdio.h> void main() { float volume,sa,r=5; const float pi = 3.14; volume = (4 * (pi*r*r*r)) / 3; sa = 4 * pi * r * r; printf("volume is %f and Surface area is %f",volume,sa); } output volume is 523.333313 and Surface area is 314.000000   •now  the program ends without any error .

Declare And Initialize A Decimal Constant And Output It's Octal And Hexadecimal Value To User

Image
D eclare And Initialize A Decimal Constant And Output It's Octal And Hexadecimal Value To User In this example, you will learn to Declare And Initialize A Decimal Constant And Output It's Octal And Hexadecimal Value To User in C language. Code For  "Declare And Initialize A Decimal Constant And Output It's Octal And Hexadecimal Value To User". /* Author --> HARSH PATEL */ #include<stdio.h> int main () { int num1=10; printf("Octal Value of %d is %o",num1); printf("\n Hexadecimal Value of %d is %x",num1); return 0; } Output Octal Value of 10 is 25556035050 Hexadecimal Value of 10 is Now Program End Without Any Error.  Learn Programming Languages Free In Our Website Coding With Harsh   5000+ Happy Visitor    Free Programing Examples In Websit E  Coding With Harsh  If Any Query Regarding Programs, Website Or More Details Email Us On  Contact@CodingWithHarsh.gq

Declare And Initialize Two Character Constants And Output It To User

Image
Declare And Initialize Two Character Constants And Output It To User In this example, you will learn to Declare And Initialize Two Character Constants And Output It To User in C language. Code For  "Declare And Initialize Two Character Constants And Output It To User". /* Author --> HARSH PATEL */ #include<stdio.h> int main() { char num1='X'; char num2='Y'; printf("num 1 is %c and 2 is %c",num1,num2); return 0; } Output num 1 is X and 2 is Y Now Program End Without Any Error.  Learn Programming Languages Free In Our Website  Coding With Harsh   5000+ Happy Visitor    Free Programing Examples In Websit E  Coding With Harsh  If Any Query Regarding Programs, Website Or More Details Email Us On  Contact@CodingWithHarsh.gq

Find Circumference Of Circle (const keyword)

Image
Find Circumference Of Circle (const keyword)  /* Author --> HARSH PATE L */ #include<stdio.h> int main() { float r = 5; float pi = 3.14; float C = 2*pi*r; printf("Cirumference of Circle = %f",C); } output Cirumference of Circle = 31.400002   •now  the program ends without any error .

Write A C Program To Find Area Of A Rectangle

Image
  Write A C Program To Find Area Of A Rectangle /* Author --> HARSH PATE L */ #include<stdio.h> int main() { int width=10; int height=20; int area=width*height;; printf("Area Of Rectangle=%d",area); } output Area Of Rectangle=200   •now  the program ends without any error .

Write A C Program To Display “ABCD” On One Line And “XYZ” On Other Line

Image
    Write A C Program To Display “ABCD” On One Line And “XYZ” On Other Line /* Author --> HARSH PATEL */ #include<stdio.h> int main() { printf("ABCD,\nXYZ"); return 0; } output ABCD, XYZ   •now  the program ends without any error .

C Program To Print Hello World

Image
  C "Hello World" Program In this example, you will learn to print "Hello World" on the screen in C language. Code For Print "Hello World". /* Author --> Harsh Patel */ #include <stdio.h> void main() { printf("Hello World"); return 0; } Output Hello World How "Hello World" program works?  The #include preprocessor command that tells the compiler to include stdio.h   The stdio.h file contains functions such as scanf() and printf() to take input and display output.  We Dont Use printf() function without writing #include The execution of a C program starts from the main() function.  printf() is a library function. In this program printf() displays "Hello World" in screen.  The return 0;  statement ends the program.  Learn Programming Languages Free In Our Website  Coding With Harsh   5000+ Happy Visitor    Free Programing Examples In Websit E  Coding With Harsh  If Any Query...