#include<iostream.h> main() { int i,count=0; for(i=0;i<10;i++) { if(count==0) { cout<<'-1 '; count=1; } if(count==1) { cout<<'1 '; count=0; } } }
I want to generate the following series in C language, please help.
1 2 3 3 4 5 4 5 6 7 5 6 7 8 9 6 7 8 9 10 11
Generate random number form 1 - 100 with probability of 1/100.You are not allowed to used rand() function. Any simple way of achieving above with using any complex implementation of random number generators algorithm.