STRUCTURED PROGRAMMING
STRUCTURED PROGRAMMING
Volume Of A Cylinder
#include<stdio.h>
#define 3.114 PI
Main ()
{
Int volume, radius, height;
radius=21;
Height=20;
Printf(“enter the radius of the cylinder\n”);
Scanf(%of”,radius);
Printf(“enter the height of the cylinder\n”);
Scanf(“%of”,height);
Volume=PI*radius*radius*height;
Printf(“volume is %*2f cm squared”, volume;
Return 0;
}
Area Of A Circle
#include<stdio.h>
#define PI 3.14
Main()
{
Float radius,area;
Printf(“enter the radius of the circle\n”);
Scanf(“%f”,&radius);
Area=PI*radius*radius;
Printf(“area is %.2f cm squared”,area);
Return0;}
Area Of A Cylinder(2(PI)RH+2(PI)RR) Volume Of A Sphere(4/3(PI)RRR)
#include<stdio.h> #include<stdio.h>
Main(){ Main(){
Printf(enter the radius of the cylinder\n”); Printf(“enter the radius of the sphere”)
Area=2*PI*radius*height+2*PI*radius*radius; Return 0;
Return 0;}
WHILE-LOOP
0-5 11-89
#include<stdio.h> #include<stdio.h>
Main(){ Main(){
Count=0; Count==11;
While(count<6){ While(count<89){
Printf(“rhe value of the count is %d/n”, count); Printf(“the value of count is %d/n”, count);
Count=count+1 Count=count+1;
}} }}
#include<stdio.h> #include<stdio.h>
Main(){ Main(){
Break; If(i==31){
} Continue;}
}} }}
GRADING
#include<stdio.h> ARRAY
Case’B’: }