C program to calculate the area and circumference of a circle-9

C program to calculate the area and circumference of a circle

C program to calculate the area and circumference of a circle Introduction Understanding the concepts of area and circumference is fundamental when working with circles. Whether you are a student learning C programming or a professional developer seeking to enhance your skills, this guide will serve as a valuable resource. We will delve into the … Read more

Calculator program in C ||Simple calculator program in C || Free Code Center

Calculator program in c

Calculator program in C #include <stdio.h> int main () { char operator; printf(“enter the operator (+ – * /)\n press A for Area of circle\n press B for circumference of circle \n press C area of rectangle\n”); scanf(“%c”,&operator); double first,second,area; printf(“enter two numbers one by one= “); scanf(“%lf %lf”,&first,&second); if (operator==’+’) { printf(“The sum is=%.3lf”,first+second); … Read more

Program to find area of square in C

Program to find area of square in c

Program to find the area of the square in C || Find area of square in C Introduction How to Calculate the Area of a Square [Step-by-Step]How to Calculate the Area of a Square [Step-by-Step]CategoriesRegularHow to Calculate the Area of a Square [Step-by-Step]In this post, we are going explain how you can solve area measures … Read more

C Program to Calculate area of right angle triangle-6

C Program to Calculate area of right angle triangle

C Program to Calculate area of right angle triangle Introduction Welcome to our comprehensive guide on calculating the area of a right-angled triangle. In this article, we will provide you with a step-by-step approach to accurately determine the area of a right-angled triangle. By following the methods outlined below, you will gain a solid understanding … Read more

Write a program in C to read 10 numbers from the keyboard and find their sum and average

10 numbers from the keyboard and find their sum and average

Write a program in C to read 10 numbers from the keyboard and find their sum and average Solution in C: #include<stdio.h> void main() { int i,n,sum=0 ;double aver=0; printf(“enter the number:”); scanf(“%d”,&n); for(i=1;i<=10;i++){ sum=sum+i; aver=sum/(double)10; } printf(“The sum of 10 no is :%d\n”,sum); printf(“The Average is :%lf”,aver); return 0; } This code is a … Read more

C programs for Practice

c programs for practice

C programs for Practice || Free Code Center Compound of interest in C #include<stdio.h> int main() {     double p,r,n,ci,a;     printf(“Enter a  Principal ,Rate of Interest and Time(y)”);     scanf(“%lf %lf %lf”,&p,&r,&n);     a=pow (1+r/100,n)*p;     ci=a-p;     printf(“Compound of interest is %.3lf”,ci);//c programs for practice } Convert day in the year #include <stdio.h> … Read more

Learn Basic C Programming Examples for beginner -2

C Programming Examples

C Programming Examples for Beginners  Section 1: Understanding the Basics of C Programming In this section, we will provide you with a comprehensive overview of the basics of C programming. We will cover topics such as data types, variables, and operators. We will also provide you with some sample code to help you get started … Read more

Sum of an array in c || Sum of array Elements in C

sum of an array in c

Sum of an array in c Example 1 #include <stdio.h> int main() { int arr[5] = {1, 2, 3, 4, 5}; // Declare and initialize an array of 5 integers int sum = 0; int i; // Calculate the sum of the elements in the array for (i = 0; i < 5; i++) { … Read more

Array Addition using 2d array in C || Add Two Matrices Using Multi-dimensional Arrays in C

2d array in C

Array Addition using 2d array in C #include<stdio.h> void main() { int i,j; int a[3][4],b[3][4],c[3][4]; for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“a[%d][%d]”,i,j); scanf(“%d”,&a[i][j]); } } for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“%d “,a[i][j]); } printf(“\n”); } for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“b[%d][%d]”,i,j); scanf(“%d”,&b[i][j]); } } for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“%d “,b[i][j]); } printf(“\n”); } printf(“\n”); printf(“sum of two array is :\n”); for(i=0;i<3;i++){ for(j=0;j<4;j++){ c[i][j]=a[i][j]+b[i][j]; } } for(i=0;i<3;i++){ for(j=0;j<4;j++){ … Read more

2D Arrays in C || C Multidimensional Arrays

2D Arrays in C

Understanding 2D Arrays in C Multidimensional arrays in C are those that have more than one dimension. They can be compared to a table with columns and rows. In C, a multidimensional array can be declared using the following syntax: data_type array_name[row_size][column_size]; For instance, we may write the following to declare a 2D array with … Read more