Write a shell script to check whether a given number is prime or not
Source Code
Problem Statement: Write a shell script to print Fibonacci series Algorithm: Here we are giving only the upper limit of the wanted Fibonacci series, by the program default the lower limit is zero. INPUT: n [upper limit] OUTPUT: Fibonacci series [up to n] Step 01: StartStep 02: read nStep 03: a ß 0Step 04: …
Shell script to print Fibonacci series with Algorithm Read More »
Problem Statement Write a C program to Make a Simple Calculator (Taking two Inputs & calculate their Addition, Subtraction. Multiplication, Division). Source Code //Write a C program to Make a Simple Calculator (Taking two Inputs & calculate their Addition, Subtraction. Multiplication, Division). #include <stdio.h> #include <stdlib.h> void main(){ float var1,var2,ans; int ch; //Taking inputs printf(“Enter …
Problem Statement Write a C program to Swap the value of two Variables. (Using a 3rd Variable & without Using a 3rd Variable) Source Code //Using a 3rd Variable #include <stdio.h> #include <stdlib.h> void main(){ float var1,var2,var3; //Taking inputs printf(“Enter Variable 1:\t”); scanf(“%f”,&var1); printf(“Enter Variable 2:\t”); scanf(“%f”,&var2); //Printing Inputs printf(“\n\nBefore Swap\n__________________\nVariable 1:\t%f\nVariable 2:\t%f”,var1,var2); //Swap using …
● Problem Statement Suppose that a hospital tested the age and body fat data for 18 randomly selected adults with the following results: Age 23 23 27 27 39 41 47 49 50 %fat 9.5 26.5 7.8 17.8 31.4 25.9 27.4 27.2 31.2 Age 52 54 54 56 57 58 58 60 61 %fat 34.6 …
● Problem Statement Use the methods provided below to normalize the following group of data: 200, 300, 400, 600, 1000 (a) min-max normalization by setting min = 0 and max = 1 (b) z-score normalization (c) z-score normalization using the mean absolute deviation instead of standard deviation (d) normalization by decimal scaling ● Algorithm Input …
Custom min-max, z-score, MAD z-score and decimal scaling normalization in Python Read More »
● Problem Statement Following data (in increasing order) is provided for the attribute ‘age’: 13, 15, 16, 16, 19, 20, 20, 21, 22, 22, 25, 25, 25, 25, 30, 33, 33, 35, 35, 35, 35, 36, 40, 45, 46, 52, 70. (a) Use smoothing by bin means to smooth these data, using a bin depth …
Problem Statement Write a shell script to check a number palindrome or not Algorithm Step 1 : Start Step 2 : Display “Enter a Number” Step 3 : read n Step 4 : temp ← n Step 5 : Repeat step 6 to 9 While temp> 0 Step 6 : ans ← ans*10 Step 7 …
Problem Statement Write a shell script to find the largest number among three numbers Algorithm Step 1 : Start Step 2 : Display “Enter 3 Numbers” Step 3 : read a Step 4 : read b Step 5 : read c Step 6 : if a>b and a>c display a is the largest Number Step …
Shell Script to find greatest of Three numbers : SOLVED with ALGORITHM Read More »
We will discuss here how to find the sum of first n natural numbers. Sum=S = 1 + 2 + 3 + 4 + 5 + ……………….. + n ❖ Algorithm Step 1 : Start Step 2 : Display “Enter the number of N” Step 3 : read n Step 4 : sum ← 0 …