Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

C program to calculate Simple Interest using function | C Programming

Basic Concept Of Function


A function is a block of code that performs a specific task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. Function can also be defined as the idea to put some repeatedly done task together by making block of statement which helps while instead of writing the same block of code again and again for different inputs, we can call the same block of statement in the program.

Note: If you want to know more about C function Click Here:

C program to calculate Simple Interest using function:-

#include<stdio.h>
int calculate();
int main()
{
 float si;
 si=calculate();
 printf("The Simple Intrest of given data is %.2f",si);
 return 0;
}
int calculate()
{
 float principal, rate, time, si;
 printf("Enter the Principal, Rate and Amount Respectively:-\n");
 scanf("%f%f%f",&principal,&rate,&time);
 si=(principal*rate*time)/100;
 return si;
}

OUTPUT

C program to calculate Simple Interest using function


Calculate Simple Interest using function with argument but no return type:- 

#include<stdio.h>
void calculate(float , float , float );
int main()
{
float principal,time,rate,si;
printf("Enter Principal, Rate and Time respectively1:-\n");
scanf("%f%f%f",&principal,&rate,&time);
calculate(principal,rate,time);
}
void calculate(float principal, float rate, float time)
{
float si;
si=(principal*time*rate)/100;
printf("The Simple Interst of given value is %.2f",si);
}

OUTPUT

C program to calculate Simple Interest using function



Calculate Simple Interest using function with no argument and no return type:- 

#include<stdio.h>
int calculate();
int main()
{
calculate();
return 0;
}
int calculate()
{
float p,t,r,si;
printf("Enter Principal, Rate and Time respectively1:-\n");
scanf("%f%f%f",&p,&r,&t);
si=(p*t*r)/100;
printf("The Simple Interst of given value is %.2f",si);
return 0;
}

OUTPUT

C program to calculate Simple Interest using function


Calculate Simple Interest using function with  argument and  return type:- 

#include<stdio.h>
int calculate(float p, float t, float r);
int main()
{
float principal,time,rate,c;
printf("Enter Principal, Rate and Time respectively1:-\n");
scanf("%f%f%f",&principal,&rate,&time);
c = calculate(principal,time,rate);
printf("The Simple Interst of given value is %.2f",c);
return 0;
}
int calculate(float p, float t, float r)
{
int si;
si=(p*t*r)/100;
return si;
}

OUTPUT

C program to calculate Simple Interest using function

Comments

Popular posts from this blog

Eliminating Epsilon transition (ε-Transitions) | Conversion of Epsilon-NFA to DFA | Conversion of Epsilon-NFA to NFA | Theory Of Computation (TOC)

C program to Find Cartesian Product of Two Sets | C programming

Top 10 Programming Language to learn in 2023