SensiZOlmuyoR.org  
Geri git   SensiZOlmuyoR.org > Pc - Bilgisayar > Programlama > C ve C++
İhbar sistemini kullanmak istermisin?


En iyi Paylaşımınız Ney¿

Cevapla
 
Konu Araçları Stil
Eski 28-01-2008, 14:12   #1 (permalink)
Banlandı
 
*MeLeK* - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: Kas 2007
Nerden: napıcan ziyaretemi geLcen!!
Mesajlar: 0
Konular: 2724
Üye No: 11416
Ruh halim:
Rep Gücü : 0
Rep Puanı : 0
Rep Seviyesi : *MeLeK* has a little shameless behaviour in the past


Standart Tersten okunduğunda kendini veren sayılar


Kod:
include <stdio.h>
#include <string.h>
int ispalindromic(unsigned long number); //returns 1 if number is palindromic

int main()
{
unsigned long counter;//for loop
unsigned long limit;//the limit entered by user.
int control;//to control if the entered value is valid
int y=1;//to control if the screen is full
printf("Please Enter the Limit \
as an integer value between 1 and 4294967295 : ");
control=scanf("%ld",&limit);
getchar();
// if no using getchar function program doesn't show numbers between
// 1 and 100 because I use getchar function to wait the enter key
// in order users to see the numbers until screen is full
while ((control==0) || (control==-1))
//if invalid value entered then give error message and scan for a new valid value
{
printf("\
An invalid value was entered.\n");
getchar();
printf("Please Enter the Limit \
as an integer value between 1 and 4294967295 : \n");
control=scanf("%ld",&limit);
}
printf("Palindromic numbers between 1 and %ld :\
\n",limit);

for (counter=1;counter<=limit;++counter)
{
if (ispalindromic(counter))
{
if (y>24)//if screen is full wait for user's reading
{
printf("Press <enter> to contiue\n");
getchar();//wait until user's pressing enter
y=1;
}
printf("%ld\
\n",counter);//if palindromic write to screen
++y;
}
}
printf("\
All palindromic numbers were shown between 1 and %ld...\
\n",limit);
printf("Press <enter> to exit\
\n");
getchar();//Wait for user's pressing enter
return 0;
}

int ispalindromic(unsigned long number) //returns 1 if number is palindromic
{
int temp;//later it will be return value of function
char snumber[11]=""; //for converting to string
int counter;
int lenght;
sprintf(snumber,"%ld",number); //converts integer to string (number==>snumber)
lenght=strlen(snumber);
temp=1;
for (counter=0;counter<lenght/2;++counter)
{
if ((int)snumber[counter]==(int)snumber[lenght-counter-1]) temp=1;
else
{
temp=0;
return temp;
}
}
return temp;
}
*MeLeK* isimli üyemiz çevrimdışıdır. (Offline)  
Bu Mesajı Google'a Ekle!Bu Mesajı FaceBook'da Paylaş!
Alıntı ile Cevapla
Cevapla

Bu konunun kısa yolunu aşağıdaki sitelere ekleyebilirsiniz!

Konu Araçları
Stil

Yetkileriniz
Konu Açma Yetkiniz Yok
Mesaj Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-KodlarıKapalı
Trackbacks are Kapalı
Pingbacks are Kapalı
Refbacks are Kapalı

Benzer Konular
Konu Konuyu Başlatan Forum Cevaplar son Mesaj
Tersten konuşalım Psikopat_Oyuncu Forum Oyunları 13 14-06-2008 20:27
Sayılar WeeeeeW Forum Oyunları 0 27-03-2008 19:07
tersten bakıon abi qRaLL Komik Resimler 3 09-03-2008 19:27
Sınırsız Sayılar Ghost Off Topic 0 08-03-2008 00:38
Kendini Kendini Bayıltmak İsteyen Varmı? GameOwer Garip olaylar 12 31-01-2008 21:22


Tüm Saatler GMT +3. Şuan Saat: 10:13 .
(Türkiye için GMT +2 seçilmelidir.)


Powered by vBulletin Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
www.SensiZOlmuyoR.org © 2007 - 2008


Bağış yapın

* Metin2 * Trendy Bayan *Sohbet * Bilgisonsuz