Posts

Showing posts with the label Algorithm
Image
Question: Write an algorithm to calculate the area of a rectangle for given breadth and length. Algorithm Question: Write an algorithm that inputs length in  inches and calculate and prints it in centimeters. Algorithm Question:  Write an algorithm that inputs marks and prints the  message “PASS” or “FAIL”. Passing marks are 33. https://www.youtube.com/watch?v=sMNZMk_KCn4
Image
  Q1.Write an algorithm to find the exponent of a given number . Ans: Planning the Solution: Input: A number and its exponent. Required Output: Exponent of given number. Processing: Multiply the number as many times as its exponent. Algorithm: Step 1: Start Let the numbers, N be 8 and its exponent,                          E be 5. Step 2: Initialize product(P) and K to 1.                          P=1, K=1 Step 3: Find the Product(P)                          P=P*N Step 4: Increment K by 1.                          K=K+1 Step 5: Check if the value of K is less than or equal to E                If K ≤ E then goto step 3 otherwise goto step 6. S...