Skip to main content

Posts

How to Calculating the area of circle using Python

  How to Calculating the area of a circle using Python:- The area of the circle is the number of square units inside the circle, can be calculated using the radius and diameter. The formula for evaluating the area of a circle is Area of circle using radius=     Pi*r*r     ( r is the radius of the circle) Area of the circle using diameter=    1/4*Pi*d*d   ( d is the diameter of the circle) Pi is a Greek letter and the value of Pi is equal to 3.14159265359. In the program, we will be initiating Pi as a global variable or we can simply import from the math module present in python. The syntax for importing pi from math module:   from import math. ALGORITHMS:- 1 .Input radius/diameter.     2 . Calculate the area of a circle using the formula.              area= pi*r*r(if radius is given as input).            ...

How to Find whether a given number is Positive or Negative in python

  How to Find whether a given number is Positive or Negative in python:-         In this Python Program, We will be discussing how to find a user-entered number that is positive or negative. We will check by using an if-else block and compare the given number with zero. If the user entered number is greater than zero then the number is positive. Else, the number is negative. ALGORITHMS:- Step 1 . Start. Step 2 . Insert the number. Step 3 . If the number is greater than zero, then print, “The number is Positive”. Step 4 . Else print, “You entered Negative”. Step 5 . Stop. CODE: -                                                                                                        num =  int ( inpu...

How to Check a given number is Even or Odd ​in python

   How to Check a given number is Even or Odd in python​:-   In this Python program, we will be finding whether a number is even or odd. Even numbers are those positive natural numbers that are evenly divisible by 2 and Odd number is just the opposite, which is not evenly divisible by 2. If a number is even then it should return a remainder is 0 when the number is divided by 2 and if it is not equal to 0, then it is an Odd Number. ALGORITHMS:- Step 1 . Start Step 2 . Insert a number. Step 3 . If the given number is divisible by 2, it prints,” Given number is even”. Step 4 . If the given number is not divisible by 2, it prints,” Given number is odd”. Step 5 . Stop CODE: - num =  int ( input ( "Enter a Number:" )) if  num %  2  ==  0 :      print ( "Given number is Even" ) else :      print ( "Given number is Odd" ) OUTPUT:- FOLLOW AND SUBSCRIBE TO THIS WEBPAGE...

Python Introduction

  Python  Introduction:- What is Python? Python is a popular programming language. It was created by Guido van Rossum , and released in 1991. Python programmers are often called Pythonists or Pythonistas. It is used for: web development (server-side), software development, mathematics, system scripting. What can Python do? Python can be used on a server to create web applications . Python can be used alongside software to create workflows. Python can connect to database systems . It can also read and modify files. Python can be used to handle big data and perform complex mathematics. Python can be used for rapid prototyping , or for production-ready software development. Why Python? Python works on different platforms ( Windows, Mac, Linux, Raspberry Pi, etc). Python has a simple syntax similar to the English language. Python has a syntax that allows developers to write programs with fewer lines than some other programming languages. Python runs on an interpreter system, m...

How to Check Whether a Number is Prime Number or Not in C

  How  to Check Whether a Number is Prime Number or Not in C:-  A number is considered as a prime number when it satisfies the below conditions.  A prime number is a number that can be divided by 1 and itself A number that can not be divided by any other number other than 1 or itself is a prime number. It should have only 2 factors. They are 1 and the number itself. ALGORITHMS:-                                               Step 1 . Read a “num” value to check prime or not. Step 2 . set i=1,div=0. Step 3 . if i<=num if true go to step 4, else go to step 7. Step 4 . Check the condition num%i==0 if true then evaluate step 5, else go to step...

How to find the Tringle is Valid or Not in C

 How to find the Tringle is Valid or Not in C:- Code:- #include <stdio.h> int  main() {        int  side_1,side_2,side_3;        int  a,b,c;       printf( "enter the value of sides:" ); scanf( "%d\n %d\n %d" ,&side_1,&side_2,&side_3);       a= ((side_1*side_1)==((side_2*side_2)+(side_3*side_3)));       b= ((side_2*side_2)==((side_1*side_1)+(side_3*side_3)));       c= ((side_3*side_3)==((side_1*side_1)+(side_2*side_2)));       if  (a || b || c)      {         printf( "The triangle is valid" );      }       else      {...

Write' The First Program' Hello World in C

 Write' The First Program' Hello World in C:- CODE:- #include <stdio.h> int  main() {     printf( " hellow world" );      return   0 ; } OUTPUT:- FOLLOW THIS WEBPAGE FOR MORE NEW PROGRAMS AND CODING SOLUTIONS.