WRITE A PROGRAM TO CALCULATE AVERAGE OF NUMBER

#include<stdio.h> int main() { printf("\n\n\t\t Welcome here \n\n\n"); int n, i; float sum = 0, x; printf("Enter number of elements: "); scanf("%d", &n); printf("\n\n\nEnter %d elements\n\n", n); for(i = 0;…

Comments Off on WRITE A PROGRAM TO CALCULATE AVERAGE OF NUMBER

Program to calculate the area of a Square

#include <stdio.h> int main() { int square_side, area; printf("Enter the side of square: "); scanf("%d", &square_side); //calculation of the area area = square_side * square_side; printf("Area of the square: %d",…

Comments Off on Program to calculate the area of a Square

Swap two Numbers using a variable

#include<stdio.h> #include<conio.h> void main() { int x = 10, y = 15, temp; temp = x; x = y; y = temp; printf("x = %d and y = %d", x,…

Comments Off on Swap two Numbers using a variable

Write a program to check whether student is pass or fail

#include<stdio.h> int main() { printf("\n\n\t\t Check Whether student is Pass or Fail\n\n\n"); int number; printf("Please enter a number:\n"); scanf("%d",&number); /* For single statements we can skip the curly brackets */…

Comments Off on Write a program to check whether student is pass or fail

Program to calculate the area of a circle

#include <stdio.h> int main() { float radius, area_circle; // take radius as input printf("Enter the radius of circle : "); scanf("%f", &radius); area_circle = 3.14 * radius * radius; printf("Area…

Comments Off on Program to calculate the area of a circle