Discover answers to your most pressing questions at Westonci.ca, the ultimate Q&A platform that connects you with expert solutions. Connect with a community of experts ready to help you find accurate solutions to your questions quickly and efficiently. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

Write a program to Find the Sum of 4 numbers​

Sagot :

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

   int a,b,c,d;//defining integer variable

   cout<<"Enter numbers:";//print message

   cin>>a>>b>>c>>d;//input numbers

   int sum=a+b+c+d;//add value in sum variable

   cout<<"4 number sum is:"<<sum;//print sum

   return 0;

}

Output:

Please find the attachment file.

Explanation:

In the program inside the main method 4 integer variable "a,b,c, and d" is declared that uses the print method to input the value from the user-end and after accepting the value an integer variable "sum" is declared that adds all input values and use a print method that prints the value with the message.

View image codiepienagoya