C program to calculate perimeter and area of a rectangle
In this program, we declare variables for the length, breadth, perimeter, and area of the rectangle. We prompt the user to enter the length and … Read more
In this program, we declare variables for the length, breadth, perimeter, and area of the rectangle. We prompt the user to enter the length and … Read more
C program to calculate perimeter and area of a square. Take sides of square as input. Sol. // C program to calculate perimeter and area of a square #include <stdio.h> int main(){ float sideOfSquare, areaOfSquare, perimeterOfSquare; printf(“Enter length of side of squaren”); scanf(“%f”, &sideOfSquare); // Perimeter of Square = 4*Side perimeterOfSquare = 4*sideOfSquare; … Read more
C Program to calculate perimeter and area of a circle, take radius as input. Sol. //C program to find area and perimeter of a circle #include<stdio.h> int main() { //In circle pi = 3.14 float radius, perimeter, area, pi=3.14; printf(“nEnter the radius of Circle : “); scanf(“%f”, &radius); // Perimeter of circle = 2πr perimeter = 2 * pi * radius; … Read more
C program to convert a number in Inch to Feet. Sol. #include<stdio.h> int main() { float inch, feet; printf(“Enter any number in Inch: n”); scanf(“%f”, & inch); //1 Feet = 0.0833333 Inch feet = 0.0833333 * inch; printf (“Value in Inch is:n%f”, feet); return 0; } Output:
C program to convert a Kilometer to Centimeter. Take kilometer as input? Sol. Cheat code: 1 Kilometer = 100000 Centimeters 1 Kilometer = 1000 Meters 1 Meter = 100 … Read more
In this program, we declare variables for meters and centimeters. We prompt the user to enter the length in meters using printf and scanf. Next, … Read more
C Program to calculate sum, difference, product, division and remainder of two numbers ? Sol. #include <stdio.h> int main() { int num1, num2, sum, difference, product, remainder ; float division; printf( “Please enter two numbers: “); scanf(“%d %d”, & num1, & num2); sum = num1 + num2; difference = num1 – num2; product = num1 * num2; … Read more
The DFA minimization is the process of reducing states in a deterministic finite automaton (DFA) and maintaining its language recognition abilities. That means, DFA minimization … Read more
Construct NFA without ∈ transitions NFA with ∈ Sol. Step 01: Find ∈-closure of (q1), (q2) and (q3). ∈-closure of (q1) = {q1, q2, q3} … Read more
Q3. UGC NET Dec 2018 To overcome difficulties in Readers-Writers problem, which of the following statement/s is/are true? 1. Writers are given exclusive access to … Read more