# program

## Python Program to find Simple Interest

This is a Python program to find the simple interest for a principal amount at a given rate for a given time. Simple Interest is given by the following formula S.I. = (P * R * T)/100 Where S.I. stands for Simple Interest, P for Principal, R for rate and …

## Python program to make a calculator

This is a python program to make a calculator. We simply take two numbers and a choice of operation from the user and display the output. To understand this example, you should have the knowledge of following topics in Python- User input Conditional Statements. User defined functions. Lets get started! …

## Python program to find square root of a number

In this program, we will calculate the square root of a number by writing some code in python. Square root of a number is a number that when multiplied by itself results in the original number. For example Square root of 9 is 3 because 3 * 3 = 9 …

## C Program to Swap Two Numbers

In this program, we will see how we can swap the values of two variables in C. To understand this program, you should know about the following topics in C: Data types Operators Input / Output We shall take two approaches, one by using a third variable and other by …

## C program to display multiplication table

In this example, you will learn how to print the table of a number given by the user. To understand this example you should have the knowledge of – Operators in C. Loops. Program Using ‘while’ loop #include <stdio.h> int main() { int num, i = 1, res; printf("Enter a …

## C Program to Find the Sum of Natural Numbers

The positive numbers such as 1,2,3,4,5…. etc are known as natural numbers. In this program, you will see how to calculate the sum up to n natural numbers. We will ask a user to enter a number and then calculate the sum up to that number. For example, if the …

## C program to Find ASCII Value of a Character

ASCII value is a numeric value assigned to every defined character (including alphabets, punctuation marks, special symbols, numbers and control characters.). For example, the ASCII value of ‘A’ is 65 whereas ASCII value of ‘a’ is 97. In C programming a character variable holds the ascii value instead of the …

## C program to take input from the user

‘User input’ in programming is simply any input a user gives during the execution of a program or application. In C, there are many standard functions to take input from the user. In this program, we will take input from the user and store it in a variable using the …

## C Program to Check Prime Number

In this program we will check if a number entered by the user is prime or not. A prime number is a number which can be divided only by 1 and itself. For example 7, 13, 17, 23 and so on. To understand this program, you must know the following …

## Python program to reverse a string

In this program we shall learn how to invert a string. For example if there is a string ‘hello’. The result should be ‘olleh’. To understand this example you should have knowledge of following topics in python – Strings Loops Looping through a string Program word = "apple" print("Given word …