Number of open doors | TCS Coding Question | C ++ program for the above approach ; Function that counts the number of doors opens after the Nth turn ; Find the number of open doors ; Return the resultant count of open doors ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int countOpenDoors ( int N ) { int doorsOpen = sqrt ( N ) ; return doorsOpen ; } int main ( ) { int N = 100 ; cout << countOpenDoors ( N ) ; return 0 ; }