Computer Science » C Program » Perimeter of Rhombus
Definition :
&
Image :
Formula :
perimeter (P) = a + a + a + a = 4a
Where,
P is the perimeter of the Rhombus
a is the side of the Rhombus
Program :
#include<stdio.h> int main() { float side,perimeter; printf("nEnter the side of Rhombus : "); scanf("%f",&side); perimeter = 4 * side; printf("nPerimeter of Rhombus : %f", perimeter); return (0); }
Output :
Enter the side of Rhombus : 2.0 Perimeter of Rhombus : 8.0
Subject Name : Computer Science |
Exam Name : IIT GATE, UPSC ESE, RRB, SSC, DMRC, NMRC, BSNL, DRDO, ISRO, BARC, NIELIT |
Posts Name : Assistant Engineer, Management Trainee, Junior Engineer, Technical Assistant |
Computer Science Books |
GATE 2023 Total Info | ENGG DIPLOMA | UGC NET Total Info |
IES 2023 Total Info | PSUs 2022 Total Info | CSIR UGC NET Total Info |
JAM 2023 Total Info | M TECH 2023 Total Info | RAILWAY 2022 Total Info |
Related Posts
Computer Science » C Program » Perimeter of Square Definition : 1. A plane rectangle with four equal sides and four right angles. 2. A four-sided regular polygon. 3. You can compute the area of a Square if you know the length of its side. Image : Formula : [php]perimeter (P) = a + a + a + a = 4a[/php] Where, P is the perimeter of the Square a is the side of the Square Program : [php]#include<stdio.h> int main() { float side,perimeter; printf("nEnter the side of Square : "); scanf("%f",&side); perimeter = 4 * side; printf("nPerimeter of Square : %f", perimeter); return (0); }[/php] Output : [php]Enter the side of Square : 2.0 Perimeter of Square : 8.0[/php]
Computer Science » C Program » Perimeter of Rectangle Definition : 1. A plane figure with 4 sides and 4 right angles and having equal opposite sides. 2. Adjucent sides makes an angle of 90 degree. 3. You can compute the area of a Rectangle if you know its length and breadth. Image : Formula : [php]perimeter (P) = l + b + l + b = 2 (l + b)[/php] Where, P is the perimeter of the Rectangle l is the side of the Rectangle Program : [php]#include<stdio.h> int main() { float length,breadth,perimeter; printf("nEnter the length of Rectangle : "); scanf("%f",&length); printf("nEnter the breadth of Rectangle : "); scanf("%f",&breadth); perimeter = 2 * (length * breadth); printf("nPerimeter of Rectangle : %f", perimeter); return (0); }[/php] Output : [php]Enter the length of Rectangle : 2.0 Enter the breadth of Rectangle : 2.0 Perimeter of Rectangle : 8.0[/php]
Computer Science » C Program » Area of Square Definition : 1. A plane rectangle with four equal sides and four right angles. 2. A four-sided regular polygon. 3. You can compute the area of a Square if you know the length of its sides. Image : Formula : [php]area (A) = a²[/php] Where, A is the area of the Square a is the side of the Square Program : [php]#include<stdio.h> int main() { int side, area; printf("nEnter the Length of Side : "); scanf("%d", &side); area = side * side; printf("nArea of Square : %d", area); return (0); }[/php] Output : [php]Enter the Length of Side : 2 Area of Square : 4[/php]
Computer Science » C Program » Check Whether a Number is Armstrong or Not Program : [php]#include<stdio.h> int main() { int num, temp, sum = 0, rem; printf("nEnter a number : "); scanf("%d", &num); temp = num; while (num != 0) { rem = num % 10; sum = sum + (rem * rem * rem); num = num / 10; } if (temp == sum) printf("n%d is a amstrong number.", temp); else printf("n%d is not a amstrong number", temp); return (0); }[/php] Output 1: [php]Enter a number : 153 153 is a amstrong number.[/php] Output 2: [php]Enter a number : 150 150 is not a amstrong number[/php]
Computer Science » C Program » Program to Print All ASCII Value Program : [php]#include<stdio.h> int main() { int i = 0; char ch; for (i = 0; i < 256; i++) { printf("%c ", ch); ch = ch + 1; }[/php] Output : [php]Å É æ Æ ô ö ò û ù ÿ Ö Ü ¢ £ ¥ ₧ ƒ á í ó ú ñ Ñ ª º ¿ ⌐ ¬ ½ ¼ ¡ « » ░ ▒ ▓ │ ┤ ╡ ╢ ╖ ╕ ╣ ║ ╗ ╝ ╜ ╛ ┐ └ ┴ ┬ ├ ─ ┼ ╞ ╟ ╚ ╔ ╩ ╦ ╠ ═ ╬ ╧ ╨ ╤ ╥ ╙ ╘ ╒ ╓ ╫ ╪ ┘ ┌ █ ▄ ▌ ▐ ▀ α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ φ ε ∩ ≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■ ☺ ☻ ♥ ♦ ♣ ♠ ♫ ☼ ► ◄ ↕ ‼ ¶ § ▬ ↨ ↑ ↓ ← ∟ ↔ ▲ ▼ ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6…