Sie sind auf Seite 1von 17

 

Start

Read/Input A, B

Sum= A+B

Print/Output Sum

Stop/End

- A B /

- /

#include<stdio.h>
main()
{
int a,b,sum;
printf("Enter the value of a and b :");
scanf("%d%d",&a,&b);
sum=a+b;
printf("The summation of a and b is:%d",sum);
}
/

Start

Read/Input A, B, C

Sum= A+B+C

Print/Output Sum

Stop/End

- A, B C /

- /

#include<stdio.h>
main()
{
int a,b,c,sum;
printf("Enter the value of a,b and c:");
scanf("%d%d%d",&a,&b,&c);
sum=a+b+c;
printf("The summation of a,b and c is:%d",sum);
}
/

Start

Read/Input A, B, C, D, E

Sum= A+B+C+D+E

Avg= Sum/5

Print/Output Sum

Print/Output Avg

Stop/End
-

- A, B, C, D E /

- /

- /

#include<stdio.h>
main()
{
int a,b,c,d,e,sum;
float avg;
printf("Enter the value of five integers:");
scanf("%d%d%d%d%d ",&a,&b,&c,&d,&e);
sum=a+b+c+d+e;
avg=sum/5;
printf("The Summation of five integers is:%d",sum);
printf("\nThe Average of five integers is:%.2f",avg);
}
/

Start

Read A, B

yes Is A>B ? no

Print A Print B

Stop

- A /

#include<stdio.h>
main()
{
int a,b;
printf("Enter the value of a and b:");
scanf("%d%d",&a,&b);
if(a>b)
printf("The Largest number is:%d",a);
else
printf("The Largest number is:%d",b);
}
। /

Start

Read A, B

yes Is A B no
?

Print A Print B

Stop

#include<stdio.h>
main()
{
int a,b;
printf("Enter the value of a and b:");
scanf("%d%d",&a,&b);
if(a b)
printf("The Smallest number is:%d",a);
else
printf("The Smallest number is:%d",b);
}
/

Start

Read A,B,C

yes Is A B ? no

yes no yes no
Is A C ? Is C>B ?

Print A Print C Print B

Stop

-
-
-

-
-

#include<stdio.h>
main()
{
int a,b,c;
printf("Enter the value of a,b and c:");
scanf("%d%d%d",&a,&b,&c);
if(a>b && a>c)
printf("The Largest number is:%d",a);
else if(b>a && b>c)
printf("The Largest number is:%d",b);
else
printf("The Largest number is:%d",c);
}
/

Start

Read A,B,C

yes Is A B ? no

yes no yes no
Is A C ? Is C B ?

Print A Print C Print B

Stop

-
-
-

-
-

#include<stdio.h>
main()
{
int a,b,c;
printf("Enter the value of a,b and c:");
scanf("%d%d%d",&a,&b,&c);
if(a b && a c)
printf("The Smallest number is:%d",a);
else if(b a && b c)
printf("The Smallest number is:%d",b);
else
printf("The Smallest number is:%d",c);
}
Start

Read F

C= (F-32)*5/9

Print C

Stop

#include<stdio.h>
main()
{
float C,F;
printf("Enter the Temperature in Fahrenheit:");
scanf("%f",&F);
C=F-32)*5/9;
printf("The Temperature in Celcius is:%.2f",C);
}
Start

Read C

F=(9*C/5)+32

Print F

Stop

#include<stdio.h>
main()
{
float C,F;
printf("Enter the Temperature in Celcius:");
scanf("%f",&C);
F=(9*C/5)+32;
printf("The Temperature in Fahrenheit is:%.2f",F);
}
Start

Read radius

Area= 3.1416*radius*radius

Print Area

Stop

#include<stdio.h>
main()
{
float radius,area;
printf("Enter the value of radius:");
scanf("%f",&radius);
area=3.14*radius*radius;
printf("The area is:%.3f",area);
}

Start

Read base,height

Area= base*height

Print Area

Stop

#include<stdio.h>
main()
{
float base,height,area;
printf("Enter the value of base and height:");
scanf("%f%f",&base,&height);
area= base*height;
printf("The area is:%.3f",area);
}

Start

Read base,height

Area= ½*base*height

Print Area

Stop

#include<stdio.h>
main()
{
float base,height,area;
printf("Enter the value of base and height:");
scanf("%f%f",&base,&height);
area= ½*base*height;
printf("The area is:%.3f",area);
}
। N
N
N

Start

Read N

S=0 ; i=1

Is i<=N ?
yes no

S=S+i Print Sum


i=i+1

End

-
-
-
- N
-
-
-
-

#include<stdio.h>
main()
{
int i,N;
long int sum=0;
printf("Enter the value of N:");
scanf("%d",&N);
printf("1+2+3+....+%d=",N);
for (i=1;i<=N;i=i+1)
{
sum=sum+i;
}
printf("%d",sum);
}
। N

Start

Read N

S=0 ; i=2

Is i<=N ?
yes no

S=S+i Print Sum

i=i+2

End

-
-
-
-
-
-
-
-

#include<stdio.h>
main()
{
int i,N;
long int sum=0;
printf("Enter the value of N:");
scanf("%d",&N);
printf("2+4+6+....+%d=",N);
for (i=2;i<=N;i=i+2)
{
sum=sum+i;
}
printf("%d",sum);
}

Start

Read N=100

S=0 ; i=1

Is i<=100 ?
yes no

S=S+i Print Sum

i=i+1

End

-
-
-
-
-
-
-
-

#include<stdio.h>
main()
{
int i;
long int sum=0;
for (i=1;i<=100;i=i+1)
{
sum=sum+i;
}
printf("1+2+3+....+100=%d",sum);
}

Start

Read N=100

S=0 ; i=2

Is i<=100 ?
yes no

S=S+i Print Sum

i=i+2

End

-
-
-
-
-
-
-
-

#include<stdio.h>
main()
{
int i;
long int sum=0;
for (i=2;i<=100;i=i+2)
{
sum=sum+i;
}
printf("2+4+6+....+100=%d",sum);
}
। N

Start

Read N

S=0 ; i=1

Is i<=N ?
yes no

S=S+i*i Print Sum

i=i+1

End

-
-
-
-
-
-
-
-

#include<stdio.h>
main()
{
int i,N;
long int sum=0;
printf("Enter the value of N:");
scanf("%d",&N);
printf("12+22+32+....+%d2=",N);
for (i=1;i<=N;i=i+1)
{
sum=sum+i*i;
}
printf("%d",sum);
}
Copyright & Prepared By: Sudip Adhikary, Dept. of Statistics, Islamic University,Kushtia.

Das könnte Ihnen auch gefallen