Sonni massiv ishlatmagan


Download 20.47 Kb.
Sana20.12.2022
Hajmi20.47 Kb.
#1038898
Bog'liq
4. Omonbayev Jaloliddin 4-amaliyot


Ma’lumotlar tuzilmasi va algoritmi


F.I.SH. Omonbayev Jaloliddin Ravshanbek o’g’li
Guruh: 911-21 guruh talabasi
Amaliyot: 4
Misol: 17
Dasturlash tili: C++ CodeBlocks

  1. Sonni massiv ishlatmagan holda teskarisiga yozuvchi rekursiv funksiya tuzing.

#include
#include
#include
int reverse(int N)
{
return ((N <= 9)) ? N : reverse(N / 10) + ((N % 10) * (pow(10, (floor(log10(
abs(N)))))));
}
void reqrusiv(int N)
{
int result = reverse(N);

printf("%d", result);


}

int main()


{
int N = 345;
reqrusiv(N);

return 0;


}



Download 20.47 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling