J

@jayanth_balamurugan_R

simple calculator using switch case.

C
2 years ago
#include <stdio.h> int main() { char op; double a,b; printf("enter your operator ('+' '-' '*' '/'): "); scanf("%c",&op); printf("\nenter two numbers: "); scanf("%lf%lf", &a, &b);

mean, median, mode

C
2 years ago
#include <stdio.h> int main() { int a,b,c,d,e,f,g,i=1,median,mode; scanf("%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f,&g); float mean; printf("enter 7 values: "); mean=(a+b+c+d+e+f+g)/7; printf("\nmean is %.2f",mean); for(i=1;i<=7;i++)

program to find out quadratic equation

C
2 years ago
#include <stdio.h> #include <math.h> int main() { int a,b,c,d,e,f; float root1, root2; printf("\nenter the coefficient of the quadratic equation: "); scanf("%d%d%d", &a,&b,&c); d=pow(b,2); e=4*a*c;

area of the circle

C
2 years ago
#include <stdio.h> int main() { const float PI = 3.14; int r; float area; printf ("enter the radius of the circle: "); scanf("%d", &r); area = PI *r *r; printf("\n the area of the circle : %.2f", area);

area of the circle using math.h

C
2 years ago
#include <stdio.h> #include <math.h> int main() { float r,area; printf("radius of the circle: "); scanf("%e",&r); area=M_PI*pow(r,2); printf("\narea=%.2f", area); return 0;

Taylor series of sin function

C
2 years ago
#include <stdio.h> #include <math.h> int fact(int a) { int f,mul=1; for (f=a;f>0;f--) { mul=mul*f; } return mul; }

Exponential func

C
2 years ago
#include <stdio.h> #include <math.h> int main() { double x; double r = 1.0; double t = 1.0; printf("\nEnter the value for x: "); scanf("%lf", &x);

program to check whether the number is prime or not

C
2 years ago
#include <stdio.h> int main() { int a,b; printf("enter an number"); scanf("%d",&a); for (b=2; b<10;b++) { if (a%b==0 && a!=2)

program to print 1 to 10 natural numbers using while loop

C
2 years ago
#include <stdio.h> int main() { int i=1; while (i<=10) { printf("\n%d ",i); i++; }

numbers from 1 to 10 using for loop

C
2 years ago
#include <stdio.h> int main() { int i; for (i=1; i<11; ++i) { printf("\n%d ",i); } return 0;

sum and avg of natural numbers

C
2 years ago
#include <stdio.h> int main() { int i, sum; float avg; for (i=1; i<11; ++i) { sum=sum+i ; }

natural numbers

C
2 years ago
#include <stdio.h> int main() { int n,a; printf("enter a number: "); scanf("%d", &n); for (a=1;a<n;++a) { printf("%d,",a); }

sum of odd numbers

C
2 years ago
#include <stdio.h> int main() { int i, n, sum; printf("the sum of the odd numbers: "); scanf("%d",&n); for(i=1;i<n+1;i= i+2) { sum=sum+i;

multiplication of a number

C
2 years ago
#include <stdio.h> int main() { int a, i, ans; printf("enter a number"); scanf("%d",&a); for (i=0;i<16;++i) { ans=i*a ;

sum of first 10 natural numbers

C
2 years ago
#include <stdio.h> int main() { int i,sum; for(i=1;i<11;++i) { sum=sum+i; } printf("%d",sum);

program to display the first 10 natural numbers.

C
2 years ago
#include <stdio.h> int main() { int i; for (i=1;i<11;++i) { printf("%d ",i); } return 0;

month

C
2 years ago
#include <stdio.h> int main() { int a; printf("enter the number\n"); scanf("%d",&a); switch(a) { case 1: printf("january");

CGPA

C
2 years ago
#include <stdio.h> int main() { int a; scanf("%d",&a); printf("enter your CGPA\n"); switch(a) case 8: printf("your obtained CGPA is 8"); break;

voting eligibility

C
2 years ago
#include <stdio.h> int main() { int a; scanf("%d",&a); switch (a) { case 18: {

Write a Program using switch case for performing operation on following conditions.

C
2 years ago
#include <stdio.h> int main() { int number1, number2; char operator; printf("enter your first number\n"); scanf("%d",&number1); printf("enter your second number\n"); scanf("%d",&number2);