C++ Program to Add Two Numbers
Here you will get C++ program to add two numbers. The program will ask user to enter two numbers and then calculate their sum. Output Enter first no: 4 Enter second no: 6 Sum = 10
Here you will get C++ program to add two numbers. The program will ask user to enter two numbers and then calculate their sum. Output Enter first no: 4 Enter second no: 6 Sum = 10
Here you will get C program to calculate compound interest. The program asks user to enter value of principle (p), rate (r) and time (t) and finally calculates the compound interest by following formula. Compound Interest = Principle * (1 + Rate / 100) time C Program to Calculate Compound Interest Output Enter Principle, Rate and …
Here you will get C program to calculate simple interest. The formula for simple interest is given below: P x r x t ÷ 100 Where, P is principal, r is rate and t is time. Lets have a look on program to calculate simple interest. C Program to Calculate Simple Interest Output: Enter principal,rate …
#include<stdio.h> #include<conio.h> #include<math.h> void main() { int x,n,result; clrscr(); //to clear the scrren printf(“Enter value of x and n:”); scanf(“%d%d”,&x,&n); result=pow(x,n); printf(“nResult=%d”,result); getch(); //to stop the screen }
In this C program you will know how to convert given number of days into years, weeks and days. For example: If user enter 1234 days then. Years = 3 Weeks = 21 Days = 1 Comment below if you are facing any problem to understand the logic of this program. Output
#include<stdio.h> #include<conio.h> void main() { int a; char ch; clrscr(); //to clear the screen printf(“Enter any character:”); scanf(“%c”,&ch); a=ch; printf(“ASCII value of %c is %d”,ch,a); getch(); //to stop the screen }
#include<stdio.h> #include<conio.h> void main() { int a,b,c,d,e,average; clrscr(); printf(“Enter marks of subject 1:”); scanf(“%d”,&a); printf(“Enter marks of subject 2:”); scanf(“%d”,&b); printf(“Enter marks of subject 3:”); scanf(“%d”,&c); printf(“Enter marks of subject 4:”); scanf(“%d”,&d); printf(“Enter marks of subject 5:”); scanf(“%d”,&e); average=(a+b+c+d+e)/5; printf(“nAverage=%d”,average); getch(); }
#include<stdio.h> #include<conio.h> void main() { float radius,area; clrscr(); //to clear the screen printf(“Enter radius of the circle:”); scanf(“%f”,&radius); area=3.14*(radius*radius); printf(“Area=%f”,area); getch(); //to stop the screen }