Find the grade of the student based on the marks obtained in five subjects. Let the grade be calculated based on the following pattern: Average Mark Range Grade 91-100 A1 81-90 A2 71-80 B1 61-70 B2 51-60 C1 41-50 C2 33-40 D 21-32 E1 0-20 E2 To calculate a student’s grade based on total marks […]
November 17, 2022 | C++ | No comments
A variable is a name that refers to a memory location. A Python variable, also known as an identifier, is used to store data. Python is not a “statically typed” language. We do not need to declare variables or their types before using them. When we first assign a value to a variable, it is […]
November 16, 2022 | python | No comments
What are Python operators? Python operators are used to perform operations on values and variables in general. These are standard symbols used in logical and arithmetic operations. In this article, we will look at various Python operators. Note: OPERAND is the value on which the operator is applied. Types of Operators: Python language supports the […]
November 15, 2022 | python | No comments
Python allows us to perform a variety of mathematical operations with ease by importing a module called “math,” which is used to access mathematical functions. These methods are only applicable to integer or real-type objects, not complex numbers. Types of pre-defined functions: Python has two kinds of pre-defined functions. Inbuilt functions: These are functions that […]
November 13, 2022 | python | No comments
Mathematical Operators: Mathematical Operators are used in mathematics to perform operations such as addition, subtraction, multiplication, and division. Python has seven arithmetic operators: Addition Subtraction Multiplication Division Modulus Exponentiation Floor division Addition: The addition operator in Python is +. It is used to combine two values. Example: Output: Subtraction: The subtraction operator in Python is […]
November 13, 2022 | python | No comments
Python Syntax Rules: Here are a few things you should know beforehand: Python is case-sensitive, which means, for example, Name and name have different meanings The standard is to use English names in programming All variables should start with a lowercase letter, for example, var = 4 Functions begin with lowercase Classes begin with a capital letter There is no command […]
November 12, 2022 | python | No comments
By using the + and – operators, we can swap two numbers without using a third variable. Main logic: Program code: Output: Note: also read about Check for palindrome number Follow Me Please follow me to read my latest post on programming and technology if you like my post. https://www.instagram.com/coderz.py/ https://www.facebook.com/coderz.py
November 12, 2022 | C++ | No comments
A palindrome number is a number that remains the same when digits are reversed. For example, the number 125521 is a palindrome number, but 1451 is not. Program Logic: First, Declare a variable reverseNum and initialize it with 0. Now, make a while loop till the original number is greater than zero. In every loop, get the last digit […]
November 12, 2022 | C++ | No comments
n1 is compared to n2. If n1 is larger than n2, it is compared to n3. If it is greater than n3 as well, n1 is the max number; otherwise, n3 is the max number. If n1 is not greater than n2, it follows that n2 is greater than n1. After that, n2 is compared to n3. […]
November 11, 2022 | C++ | No comments
A prime number is greater than one and can be divided by one or itself. In other words, prime numbers cannot be divided by anything other than themselves or 1. Prime numbers include 2, 3, 5, 7, 11, 13, 17, 19, 23, etc. Program code: Output: Note: also read about Diamond Pattern Using Numbers Follow Me […]
November 11, 2022 | C++ | No comments