I am Md. Anisur Rahman. I have completed Cyber Security for MSCSE at United International University in 2022.I have completed PGDIT from IIT, Jahangirnagar University in 2020. I'm a Head of IT at Programming24 School.
Function Main
Declare Real num1
Declare Real num2
Declare Real num3
Output "Enter three numbers: "
Input num1
Input num2
Input num3
If num1>=num2
If num1>=num3
Output "The larggest numner is: " &num1
Else
Output "The larggest numner is: " &num3
End
Else
If num2>=num3
Output "The larggest numner is: " &num2
Else
Output "The larggest numner is: " &num3
End
End
End
#include <stdio.h>
#include <stdlib.h>
int main()
{
double num1;
double num2;
double num3;
printf("Enter three numbers:\n");
scanf("%lf %lf %lf", &num1, &num2, &num3);
if (num1 >= num2) {
if (num1 >= num3) {
printf("The largest number is: %.2lf\n", num1);
} else {
printf("The largest number is: %.2lf\n", num3);
}
} else {
if (num2 >= num3) {
printf("The largest number is: %.2lf\n", num2);
} else {
printf("The largest number is: %.2lf\n", num3);
}
}
return 0;
}
Function Main
Declare Integer n
Declare Integer i
Declare Integer fact
Assign fact = 1
Output "Enter an integer: "
Input n
If (n<0)
Output "Error! Factorial of a negative number doesn't exist."
Else
For i = 1 to n
Assign fact = fact * i
End
Output "Factorial is " &fact
End
End
#include <stdio.h>
int main() {
int n, i;
int fact = 1;
printf("Enter an integer: ");
scanf("%d", &n);
if (n < 0)
printf("Error! Factorial of a negative number doesn't exist.");
else {
for (i = 1; i <= n; ++i) {
fact *= i;
}
printf("Factorial is %d",fact);
}
return 0;
}
Function Main
Declare Integer n
Declare Integer reverse
Assign reverse = 0
Declare Integer remainder
Output "Enter an integer: "
Input n
While (n!=0)
Assign remainder = n % 10
Assign reverse = reverse * 10 + remainder
Assign n = n / 10
End
Output " Reversed number = " &reverse
End
Function Main
Declare Real celsius
Declare Real fahrenheit
Output "Enter temperature in Celsius: "
Input celsius
Assign fahrenheit = (celsius * 9 / 5) + 32
Output "Fahernheit is : " &fahrenheit
End
Function Main
Declare Real radius
Declare Real area
Declare Real Circumference
Output "Enter the radius of Circle : "
Input radius
Assign area = 3.1416 * radius * radius
Assign Circumference = 2 * 3.1416 * radius
Output "Area of Circle : " &area
Output "Circumference of circle: " &Circumference
End
Function Main
Declare Integer i
Declare Integer j
Declare Integer n
Output "Enter a number: "
Input n
For i = 1 to n
For j = 1 to i
Output "* "
End
Output ""
End
End
#include <stdio.h>
int main()
{
int i;
int j;
int n;
printf("Enter a number:");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
printf("* "); // output * pattern or number or symbol
}
printf("\n");
}
return 0;
}
// This code show us left, right, inverted pattern, if we can organized it.
#include <stdio.h>
int main()
{
int i, j, k, rows;
printf("Enter the no. of rows: ");
scanf("%d", &rows);
for (i = 1; i <= rows; i++)
{
// for (j = i; j <= rows; j++)
// printf(" ");
for (k = 1; k <= i; k++)
printf(" %d", k);
printf("\n");
}
return 0;
}
#include <stdio.h>
int main()
{
int i, j, rows, k = 0;
printf (" Enter a number of rows:");
scanf ("%d", &rows);
for ( i =1; i <= rows; i++)
{
for ( j = 1; j <= rows - i; j++)
{
printf (" ");
}
// use for loop where k is less than equal to (2 * i -1)
for ( k = 1; k <= ( 2 * i - 1); k++)
{
printf ("%d ", k); }
printf ("\n");
}
}
Function Main
Declare Real base
Declare Real height
Declare Real Area
Declare Real Perimeter
Output "Enter value of base:"
Input base
Output "Enter height: "
Input height
Assign Area = (base * height)
Output "The Area is: " &Area
Assign Perimeter = (base + height) * 2
Output "The Perimeter is: " &Perimeter
End
Function Main
Declare Real base
Declare Real height
Declare Real Area
Output "Enter base: "
Input base
Output "Enter height:"
Input height
Output "The area of the triangle is "
Output (base * height) / 2
End