Computer Science, asked by vidhipatidsrswt4508, 1 month ago

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 pathakrishikesh1999
2

Answer:

#include<iostream>

using namespace std;

int main()

{

 int n;cin>>n;

 cout<<(n*(n-1))/2;

}

Explanation:

Answered by vinod04jangid
0

Answer:

written below-

Explanation:

#include

iostream

{using namespace std;

int main()

{int n;cinn;

cout(n*(n-1)/2;}

#SPJ3

Similar questions