#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
#include <stdio.h>
#include <conio.h>
using namespace std;
int main(){
int sifre4;
int sifre3;
int sifre2;
int sifre1;
int x,y,z;
int i;
i=0;
x=0;
y=0;
z=0;
int r1, r2 ,r3 ,r4;
srand (time(NULL));
for (int i=0;i<100;i++){
r1 = rand() % 10 + 1;
r2= rand() % 10 + 1;
r3= rand() % 10 + 1;
r4= rand() % 10 + 1;
cout << r1,r2,r3,r4 ;
}
r1 =sifre1;
r2 =sifre2;
r3 =sifre3;
r4= sifre4;
while(x<sifre1) {
x=x+1;
}
if(x=sifre1){
cout << x;
}
while(y<sifre2){
y=y+1;
}
if(y=sifre2){
cout << y;
}
while(z<sifre3){
z=z+1;
}
if(z=sifre3){
cout << z;
}
while(i<sifre4){
i=i+1;
}
if(i=sifre4) {
cout << i;
}
}
Rastgele karakter üretmesi gerekirken her seferinde aynı karakteri üretiyor nasıl düzeltebilirim.
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
#include <stdio.h>
#include <conio.h>
using namespace std;
int main(){
int sifre4;
int sifre3;
int sifre2;
int sifre1;
int x,y,z;
int i;
i=0;
x=0;
y=0;
z=0;
int r1, r2 ,r3 ,r4;
srand (time(NULL));
for (int i=0;i<100;i++){
r1 = rand() % 10 + 1;
r2= rand() % 10 + 1;
r3= rand() % 10 + 1;
r4= rand() % 10 + 1;
cout << r1,r2,r3,r4 ;
}
r1 =sifre1;
r2 =sifre2;
r3 =sifre3;
r4= sifre4;
while(x<sifre1) {
x=x+1;
}
if(x=sifre1){
cout << x;
}
while(y<sifre2){
y=y+1;
}
if(y=sifre2){
cout << y;
}
while(z<sifre3){
z=z+1;
}
if(z=sifre3){
cout << z;
}
while(i<sifre4){
i=i+1;
}
if(i=sifre4) {
cout << i;
}
}
Rastgele karakter üretmesi gerekirken her seferinde aynı karakteri üretiyor nasıl düzeltebilirim.