I'm doing a program where enter something and then if I decide to change it, I can do it but I don't know what condition to use | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

I'm doing a program where enter something and then if I decide to change it, I can do it but I don't know what condition to use

#include <iostream> using namespace std; int main() { int cant; string num[10]; int i; int op; string mod,mod2; printf("num: "); cin >> cant; for(i = 0; i < cant; i++){ printf("\ninsert: "); cin>>num[i]; } printf("\n(1) ver num\n(2) modificar num"); printf("\n\noption: "); cin >> op; cout<<endl; switch(op){ case 1: for(i = 0; i < cant; i++) cout <<"num: "<< num[i]; break; case 2: for(i = 0; i < cant; i++){ cout <<"num: "<< num[i] << endl; } printf("\nModificar: "); cin >> mod; printf("\nPor cual: "); cin >> mod2; if(mod == num[i]){ num[i] == mod2; cout << "hh: " << num[i]; } break; } }

20th May 2020, 11:11 PM
KeynerZzz
KeynerZzz - avatar
1 Antwort
0
Can you explain more what you want with this code
24th May 2020, 10:01 AM
Arpit kumar jain
Arpit kumar jain - avatar