# Category Archives: Program

## Write a program in C++ & Python to print the 1 to 10 Multiples of a Number

Here in this, we will code a program that will accept an integer from a user and print a table for that number. For example, if the user enters 7 then the program will print the table of 7. Multiples of a Number C++: #include<iostream.h> #include< conio.h> #include<stdio.h> #include<math.h> void main() { clrscr(); int n;… Read More »

## Write a program in C++ & python to calculate the Factorial of an Integer

In this program, we will code to calculate the factorial of an integer. Factorial is a math concept which has a! sign For example, 3 factorials would be represented as 3! = 3*2*1 0! = 1 Factorial of an Integer C++: #include<iostream.h> #include< conio.h> #include<stdio.h> #include<math.h> void main() { clrscr(); int num,fact=1; cout<<“Enter a number:… Read More »

## Write a Program in C++ & Python to display the first n natural numbers and their sum

Here in this program first we will ask the user to enter a number and then print the sum up to that number. For example, if the user enters 4 the output should be 10 = 4+3+2+1 C++: #include<iostream.h> #include< conio.h> #include<stdio.h> #include<math.h> void main() { clrscr(); int num,sum=0; cout<<“Enter a number: “; cin>>num; for(int… Read More »

## Write a Program C++ & Python to calculate the sum of two numbers

In this program we will ask user to enter 2 numbers and print their sum as an output. for example, if the user enters 2 number 3.2 and 4.5 the output should be 7.7

## C++ & Python program that calculates the area of a circle and accept radius from user

In this program we will calculate the radius of the circle, first, we ask the user to enter the radius of the circle and by using the formula A = πr2 A = area of a circle π = pi which value is 3.14 r = radius of the circle. C++: #include<iostream.h> #include< conio.h> #include<math.h>… Read More »

## C++ & Python program to print the ASCII value of a character

ASCII stands for American Standard Code for Information Interchange and it defines that each character in a programming language has a fixed ASCII value and it always a positive integer. The character includes every single element and it could be symbols too

## Write a Program in C++ & Python to convert a given number of days into years, weeks and days

Here in this program, the user will enter a number and our program will filter that number into years, weeks and days. For example, if the user enters 365 days the output should be 1 year 0 weeks 0 days Here we are not considering leap years.

## Write a program in C++ & Python to raise any number x to a Positive Power n

Here we have provided two programs to raise any number x to a power n; in C++ and python. Here x would be the number whose power to be raised, n will be the number which represents the value of power. For example, if x is 2 and n is 4 the output should be… Read More »

## Write a Program in C++ & Python to find whether a number is a palindrome or not

This code checks whether the entered number is a palindrome or not. A palindrome number is a unique number which reverse is equal to it. For example, 11, 111, 121, 131… are palindrome numbers.

## Write a program in C++ & python to check whether the entered number is prime or not

In this program, we will code to find the number is prime or not. A number is said to be a prime number if it has only 2 divisors 1 and the number itself.