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

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

How do you add one object to another object in CPP?-3

How do you add one object to another object in CPP

How do you add one object to another object in CPP? In C++, objects are created using classes. A class is a user-defined data type that defines a blueprint for creating objects. One of the most common operations performed on objects is adding one object to another object. This operation is known as object addition, … Read more

How to use a string in Object-Oriented Programming Cpp

How to use a string in Object-Oriented Programming Cpp

How to use a string in Object-Oriented Programming Cpp Are you new to object-oriented programming and wondering how to use a string in C++? Look no further. In this comprehensive guide, we will cover everything you need to know about using a string in object-oriented programming. How to Use a String in Object-Oriented Programming C++ … Read more