AI Lab Report
AI Lab Report
Output:
Description:
The standard deviation measures the spread of the data about the mean value. It
is useful in comparing sets of data that may have the same mean but a different
range. For example, the mean of the following two is the same: 15, 15, 15, 14, 16
and 2, 7, 14, 22, 30. However, the second is clearly more spread out.
Output:
Description:
To prove whether a number is a prime number, first try dividing it by 2, and see if
you get a whole number. If you do, it can't be a prime number. If you don't get a
whole number, next try dividing it by prime numbers: 3, 5, 7, 11 (9 is divisible by 3)
and so on, always dividing by a prime number
3. Problem: Use one function for taking input and another for calculating the
radius of the circle and square area
Code:
Output:
Description:
The area of a circle is the region occupied by the circle in a two-dimensional plane.
It can be determined easily using a formula, A = πr2, (Pi r-squared) where r is the
radius of the circle. The unit of area is the square unit, such as m 2, cm2, etc. The
formula for calculating the area of a square can be written like this: Area of square
(A) = Length = Breadth = a × a = a2 where a is the side of the square. All sides of
the square has equal lengths.
Output:
Description:
Reversing a number in C programming means changing all the digits of a number to
bring the digit at the last position to the first position and vice-versa. Suppose you
take the number 1234; the reverse is 4321.
Code:
Output:
Description: The sequence follows the rule that each number is equal to the sum of
the preceding two numbers. The Fibonacci sequence begins with the following 14
integers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 ... Each number, starting with
the third, adheres to the prescribed formula.
6. Problem: Pattern Print
Code:
Output:
Description:
Pattern programs are patterns/designs/symbols consisting of numbers, alphabets or
symbols in a particular form. These kinds of the patterns are solved using looping
structures. Pattern programs best means to study the working of looping structures
in general-purpose programming languages.
Lab Report
Artificial Intelligence