diff --git a/README.md b/README.md index 98ba3380..df158a98 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ | Program-17 | Program to check whether the given number is prefect or not | | Program-18 | Program to check given number is Armstrong or not | | Program-19 | Program to find power of a given number | +| Program-20 | Program to convert datatype explicitly | | Program-21 | Program to check whether the given number is prime or not | | Program-22 | Program to find GCD and LCM of given two number | | Program-23 | Program to find number of digits in a given number | diff --git a/program-20/program.c b/program-20/program.c index bfe8670d..ed865cda 100644 --- a/program-20/program.c +++ b/program-20/program.c @@ -1,8 +1,20 @@ -#include -void main() -{ -if(printf("hello world\n")) -{ +#include +#include -} +int main() +{ int a=7,b=2; + // printf("enter two number !\n"); + //scanf("%d%d",&a,&b); + printf("%d",a/b); + + printf("%d\n",(float)a/b); + printf("%d\n",(float)a/(float)b); + printf("%d\n",a/(float)b); + + printf("%f\n",a/b); + printf("%f\n",(float)(a/b)); + printf("%f\n",(float) a/b); + printf("%f\n",(float)a/(float)b); + printf("%f\n",a/(float)b); + return 0; }