بتاريخ: 23 يوليو 200718 سنة comment_105508 Salam,I've a question, lets assume that we have an integer value of "1234", how can I conver it and print it from right to left. i.e. to be print as "4321" ?Note: it's defined as integer datatype.Thanks,Cucumber تقديم بلاغ
بتاريخ: 24 يوليو 200718 سنة comment_105565 اعمل CREATE OR REPLACE FUNCTION SWAP (X integer)RETURN Number IS i integer ; n integer ; tmp integer ; NewX integer ; STR varchar2(100);begin str := to_char(x); select length(str) into n from Dual; tmp := ''; for i in 1..n loop tmp := substr(x,i,1) || tmp ; end loop; NewX := tmp; return Newx;end;/ثم select swap(4321) from dual ; أو اي رقم انت تريده تم تقديم بلاغ
بتاريخ: 25 يوليو 200718 سنة كاتب الموضوع comment_105682 Salam 3likom,Thank you guys, actually I managed it through.This is my code:#include <iostream>#include <conio>void main() {cout<<"Enter the integer value: "<<endl;char strvar1[200];cin>>strvar1;for(int i=(strlen(strvar1)-1); i>=0; i--){cout<<strvar1;}getch();} تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.