C Program to Calculate Cube of a Number || practice coding

C Program to Calculate Cube of a Number

How to write a C Program to Calculate Cube of a Number using Functions with an example? C Program to Calculate Cube of a Number #include<stdio.h> void main () { int i,cube; scanf(“%d”,&i); for(int i=1;i<=5;i++){ cube=i*i*i; printf(“\nnumber is %d and cube of the %d is :%d”,i,i,cube); } } C Program to Calculate Cube of a … 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