Answer to Question #286992 in C for Anu

Question #286992

The placement season has begun in a college. There are N number of students standing outside an interview room in a line. It is given that a person who goes in first has higher chances of getting selected

1
Expert's answer
2022-01-12T12:38:05-0500
#include<conio.h>
#include <iostream>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include <cmath>
#include<dos.h>
#include <bits/stdc++.h> 
#include<vector>
using namespace std;




#define N	5
int main()
{
	float Prob,Sum=0;
	int r,n=1;
	
	for(r=1;r<=N;r++) Sum = Sum + r;
	
	for(r=N;r>=1;r--)
	{
		Prob = float(r)/Sum;
		printf("\n\tProb. of Student no. %d = %.3f",n,Prob);
		n++;
	}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS