+ 2

What is the output of this code..

#include <iostream> using namespace std; int main() { int d=0; do { d=d+(rand()%1); d++; } while(d!=5); cout<<d; }

27th Jun 2018, 6:37 AM
Kuldeep vishwakarma
Kuldeep vishwakarma - avatar
3 Answers
0
Either 5 or it never outputs.
27th Jun 2018, 7:45 AM
StefanGliga
StefanGliga - avatar
0
5
27th Jun 2018, 8:35 AM
Dileep Kumar
Dileep Kumar - avatar
0
5 obviously
27th Jun 2018, 12:13 PM
Aveek Bhattacharyya
Aveek Bhattacharyya - avatar