Handshakes
It was Stefan's first day at school. His teacher Elena Gilbert asked the students to meet every other student in the class and introduce about themselves. The teacher asked them to handshake with each other when they meet. If there are n number of students in the class then find the total number of handshakes made by the students.
INPUT & OUTPUT FORMAT:
Input consists of 1 integer. First input corresponds to the total number of students. The output consists of 1 integer.
Answers
Answered by
2
Answer:
#include<iostream>
using namespace std;
int main()
{
int n;cin>>n;
cout<<(n*(n-1))/2;
}
Explanation:
Answered by
0
Answer:
written below-
Explanation:
#include
iostream
{using namespace std;
int main()
{int n;cinn;
cout(n*(n-1)/2;}
#SPJ3
Similar questions
Computer Science,
22 days ago
History,
22 days ago
Math,
1 month ago
Physics,
1 month ago
Math,
8 months ago