Download Our Mobile App
#include <stdio.h>
#include<conio.h>
int main() {
float pie = 3.14;
int radius;
printf("Enter The Radius of Cicle:");
scanf("%d",&radius);
printf("The radius of the circle is %d\n" , radius);
float area = (float)(pie* radius * radius);
printf("The area of the given circle is %f", area);
return 0;
}
#include <stdio.h>
int main()
{
float eng, phy, chem, math, comp;
float total, average, percentage;
printf("Enter marks of five subjects: :- ");
scanf("%f%f%f%f%f", &eng, &phy, &chem, &math, &comp);
total = eng + phy + chem + math + comp;
average = total / 5.0;
percentage = (total / 500.0) * 100;
printf("Total marks = %.2f\n", total);
printf("Average marks = %.2f\n", average);
printf("Percentage = %.2f", percentage);
return 0;
}
#include<stdio.h>
int main()
{
printf("sbn school code \n");
int a;
int b;
printf("Enter your age A\n");
scanf("%d",&a);
printf("Enter your friend age B\n");
scanf("%d",&b);
int sum =a+b;
sum = sum / 2;
printf("Your average age is %d",sum);
}
#include<stdio.h>
int main ()
{
printf("Sbn learing center \n");
int a;
int b;
int c;
printf("Add a number A\n");
scanf("%d",&a);
printf("Add a number B\n");
scanf("%d",&b);
printf("Add a number C\n");
scanf("%d",&c);
int sum = a+b+c;
printf("The result is %d",sum);
}
#include<stdio.h>
int main()
{
printf("sbn school learning center \n");
int a;
int b;
printf("Enter your number \n");
scanf("%d",&a);
printf("Enter your secound number \n");
scanf("%d",&b);
int sum = a+b;
printf("The result is %d",sum);
}
#include <stdio.h>
int main()
{
int num1, rem1;
printf("Input an number to find odd / even number ;=-sbn school\n: ");
scanf("%d", &num1);
rem1 = num1 % 2;
if (rem1 == 0)
printf("%d is an even number\n", num1);
else
printf("%d is an odd number \n", num1);
printf("Enter another number also to cheak odd or even number \n");
scanf("%d",&num1);
rem1 = num1/2;
if(rem1==0)
printf("%d is an even number \n",num1);
else
printf("%d is an odd number \n", num1);
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main ()
{
printf("This code is from sbn online school");
char ab;
double a, b, sum, diff, product, divide;
printf("Select a operator :(+,-,*,/) \n ");
scanf("%s",&ab);
printf("Enter your Number :\n ");
scanf("%d",&a);
printf("Enter your Another Number :\n ");
scanf("%d",&b);
switch(ab) {
case '+':
sum = a+b;
printf("The sum is %d",sum);
break;
case '-':
diff = a-b;
printf("The difference is %d",diff);
break ;
case '*':
product = a*b;
printf("The product is %d",product);
break ;
case '/':
divide = a/b;
printf("The result is %d",divide);
break ;
}
return 0 ;
}
#include<stdio.h>
#include<conio.h>
int main () {
int i = 1;
do {
printf("%d \n",i);
i++;
}
while (i<=10);
getch ();
}
Result