diff --git a/README.md b/README.md index a09b6e2..200d658 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # Step-1-Code This repo is for your first open source contribution! Just add some beginner projects and complete your Hacktoberfest 2020 challenge. +# Step-2-Test and debug +Testing is the process to find bugs and error and debugging is the process to correct the bugs found during testing. diff --git a/calculator using C programming b/calculator using C programming new file mode 100644 index 0000000..806bfff --- /dev/null +++ b/calculator using C programming @@ -0,0 +1,36 @@ +#include +#include + +main() +{ +float a,b,c, result; +printf("enter the numbers and the operation."); +scanf("%d %d" %d, &a,&b,&c); +printf("select operation"); +switch (c) +{ +case 1: + return a+b; + break; +case 2: + return a-b; + break; +case 3: + return a*b; + break; +case 4: + return a/b; + break; +case 5: + return pow(a,b) + break; +case 6: + return sqrt(a); + break; +case 7: + return log(a); + break; +} +printf("result = %d", result); +return 0; +}