C Programming Examples

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

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 …

Write a program in C to read 10 numbers from the keyboard and find their sum and average 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> …

C programs for Practice Read More »

C Programming Examples

Learn Basic C Programming Examples for beginner -2

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 …

Learn Basic C Programming Examples for beginner -2 Read More »

2d array in C

Array Addition using 2d array in C || Add Two Matrices Using Multi-dimensional Arrays 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++){ …

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

2D Arrays in C

2D Arrays in C || C Multidimensional Arrays

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 …

2D Arrays in C || C Multidimensional Arrays Read More »

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck