+ 2
Write minimum and maximum value
#include<iostream.h> #include<stdlib.h> void main() { randomize(); int marks[]={99,92,94,96,93,95},Mymarks; Mymarks =marks[1+random(2)]; cout<<Mymarks<<endl; }
1 Réponse
+ 2
You can define min and max as the first element and check every element in the array and compare with min and max value, or you can sort the array with any method and take first and last elements from it as min and max, depending how you sorted it 👌👌👌