1.Write a program in C language to add two numbers 2.Write a program in C language to…
- User
1.Write a program in C language to add two numbers 2.Write a program in C language to print the following output :
My name is <PRESIDIO_ANONYMIZED_PERSON> Class : B.Voc(SD) Roll No : 239401 Thank you 3.Write a program in C language to perform addition subtraction multiplication division on two numbers entered by user 4.Write a program in C language to calculate the area of circle
- Assistant
- Program to add two numbers:
c#include<stdio.h> int main() { int num1, num2, sum; printf("Enter first number: "); scanf("%d", &num1); printf("Enter second number: "); scanf("%d", &num2); sum = num1 + num2; printf("Sum of two numbers is: %d", sum); return 0; }- Program to print the given output:
c#include<stdio.h> int main() { printf("********\n"); printf("My name is Manmehar Singh Gill\n"); printf("Class: B.Voc(SD)\n"); printf("Roll No: 239401\n"); printf("Thank you\n"); return 0; } - User
Give explanation also
- Assistant
- Program to add two numbers:
In this program, we first declare three variables -
num1,num2, andsumto store two input numbers and the sum of these numbers, respectively. We then prompt the user to enter the first number using theprintffunction and read the input using the function. Similarly, we prompt for the second number and read its input. We then add the two numbers using the operator and store the result in the variable. Finally, we use the function to display the result.