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

C program to find area and Perimeter of Rectangle-1

C program to find area and Perimeter of Rectangle

C program to find area and Perimeter of Rectangle #include<stdio.h> int main() { int length,wight,area=0; printf(“Enter a length and wight:”); scanf(“%d %d”,&length,&wight); area=length*wight; printf(“area of rectangle is:%d”,area); return 0; } C program to find area and Perimeter of Rectangle This code is a simple C program that calculates the area of a rectangle based on … Read more

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

Write a program sum of first n natural numbers in C.

sum of first n natural numbers in c

Write a program sum of first n natural numbers in C. #include<stdio.h> void main () { int i,n ,sum= 0; scanf(“%d”,&n); printf(“The first 7 natural is:”,n); for(int i=1;i<=7;i++) { printf(“%d “,i); sum=sum+i; } printf(“\nThe Sum of Natural Number upto 7 terms : %d”,sum); return 0; } Write a program in C to display the first … Read more

Write a program in C to display the first 10 natural numbers.

Write a program in C to display the first 10 natural numbers

Example 1.Write a program in C to display the first 10 natural numbers. #include<stdio.h> void main () { int i,n; scanf(“%d”,&n); printf(“The first 10 natural numbers are: “,n); for(int i=1; i<=n;i++) { printf(“%d “,i); } } When you run this code, it will output the numbers 1 through 10 separated by spaces. The loop will … Read more

Searching for a Value in an Array in C Programming

Array in C Programming

Searching for a Value in an Array in C Programming Programming languages are used to communicate with computers and to create software applications. C programming language is one of the most popular programming languages used for system programming, embedded systems, and game development. One of the essential aspects of programming is searching for values in … Read more

A Beginner’s Guide to Understanding C Programming Basics-3

Array in C Programming

C Programming Basics Problems for Beginners 1. Generating a series of numbers and calculating their sum in V Generating like 9 99 999 9999 99999 and there sum #include <stdio.h> void main() { long int n,i,t=9; int sum =0; printf(“Input the number or terms :”); scanf(“%d”,&n); for (i=1;i<=n;i++) { t=t*10+9; sum =sum+t; printf(“%d “,t); } … Read more

Arrays of Characters in C-1

Arrays of Characters in C

Arrays of Characters in C || Array of characters in c || How to declare an array of characters in c Arrays of Characters in C Here are a few examples of char array problems: 1. Reversing a string: Write a program that takes a string as input and returns the string in reverse order. … Read more