hoSSohbeT.com  Sohbet  forumlari

Anasayfa Bugünki Mesajlar Forumları Okundu Kabul Et
Geri git   hoSSohbeT.com Sohbet forumlari > Bilgisayar ve İnternet Dünyası > Bilgisayar - İnternet > Bilgisayar Dünyası > Programlama > C ve C++
Kayıt ol Yardım Sohbet Gazete oku Diyetsaglik Üye Listesi Ajanda Arama Bugünki Mesajlar Forumları Okundu Kabul Et



Cevapla
 
LinkBack Seçenekler Stil
Alt 04-09-08, 17:23   #21
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

Sistem saatini simge ile güncel olarak ekrana yazdıran bir program
PHP- Kodu:
#include <iostream.h>
#include <dos.h>
#include <conio.h>
 
int sayilar[10][5][8]=     {  {    {0,0,1,1,1,0,0,0},
                                        {
0,0,1,0,1,0,0,0},
                              {
0,0,1,0,1,0,0,0},
                              {
0,0,1,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    },
                                    {    {
0,0,0,1,0,0,0,0},
                                        {
0,0,1,1,0,0,0,0},
                              {
0,0,0,1,0,0,0,0},
                              {
0,0,0,1,0,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    },
                           {    {
0,0,1,1,1,0,0,0},
                                        {
0,0,0,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0},
                              {
0,0,1,0,0,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    },
                           {    {
0,0,1,1,1,0,0,0},
                                        {
0,0,0,0,1,0,0,0},
                              {
0,0,0,1,1,0,0,0},
                              {
0,0,0,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    },
                           {    {
0,0,0,0,1,0,0,0},
                                        {
0,0,0,1,1,0,0,0},
                              {
0,0,1,0,1,0,0,0},
                              {
0,0,1,1,1,1,0,0},
                              {
0,0,0,0,1,0,0,0}
                                    },
                           {    {
0,0,1,1,1,0,0,0},
                                        {
0,0,1,0,0,0,0,0},
                              {
0,0,1,1,1,0,0,0},
                              {
0,0,0,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    },
                           {    {
0,0,1,1,1,0,0,0},
                                        {
0,0,1,0,0,0,0,0},
                              {
0,0,1,1,1,0,0,0},
                              {
0,0,1,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    },
                           {    {
0,0,1,1,1,0,0,0},
                                        {
0,0,1,0,1,0,0,0},
                              {
0,0,0,0,1,0,0,0},
                              {
0,0,0,0,1,0,0,0},
                              {
0,0,0,0,1,0,0,0}
                                    },
                           {    {
0,0,1,1,1,0,0,0},
                                        {
0,0,1,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0},
                              {
0,0,1,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    },
                           {    {
0,0,1,1,1,0,0,0},
                                        {
0,0,1,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0},
                              {
0,0,0,0,1,0,0,0},
                              {
0,0,1,1,1,0,0,0}
                                    }
                        };
 
int simge [3][1] =    {  {1},
                        {
0},
                        {
1}
                            };
void simgeKoy(int x,int y)
{
     for (
int i =0;i<3;i++)
   {
        for (
int k =0;k<1;k++)
      {
           if (
simge[i][k] == 1)
         {
            
gotoxy(x+k,y+i);
              
cout<<(char)219;
         }
      }
   }
}
 
void cerceve (int x1,int y1,int x2,int y2)
{
    for (
int i x1;i<=x2;i++)
   {
        
gotoxy(i,y1);cout<<"*";
      
gotoxy(i,y2);cout<<"*";
   }
 
   for (
int i y1;i<=y2;i++)
   {
        
gotoxy(x1,i);cout<<"*";
      
gotoxy(x2,i);cout<<"*";
   }
}
 
int main ()
{
   
struct time zaman;
   
int bSaat,kSaat,bDakika,kDakika,bSaniye,kSaniye;
 
    do
   {
        
gettime(&zaman);
 
      
bSaat zaman.ti_hour/10;
      
kSaat zaman.ti_hour%10;
      
bDakika zaman.ti_min/10;
      
kDakika zaman.ti_min%10;
      
bSaniye zaman.ti_sec/10;
        
kSaniye zaman.ti_sec %10;
 
      
//saat
        
for (int i=0;i<5;i++)
      {
            for (
int k =0;k<9;k++)
            {
                if (
sayilar[bSaat][i][k] == 1)
              {
                   
gotoxy(k+10,i+10);
                  
cout<<(char)219;
               }
            if (
sayilar[kSaat][i][k] == 1)
              {
                   
gotoxy(k+14,i+10);
                  
cout<<(char)219;
               }
            }
      }
      
simgeKoy(20,11);
 
      
//dakika
      
for (int i=0;i<5;i++)
      {
            for (
int k =0;k<9;k++)
            {
                if (
sayilar[bDakika][i][k] == 1)
              {
                   
gotoxy(k+20,i+10);
                  
cout<<(char)219;
               }
            if (
sayilar[kDakika][i][k] == 1)
              {
                   
gotoxy(k+24,i+10);
                  
cout<<(char)219;
               }
            }
      }
      
simgeKoy(30,11);
 
      
//saniye
      
for (int i=0;i<5;i++)
      {
            for (
int k =0;k<9;k++)
            {
                if (
sayilar[bSaniye][i][k] == 1)
              {
                   
gotoxy(k+30,i+10);
                  
cout<<(char)219;
               }
            if (
sayilar[kSaniye][i][k] == 1)
              {
                   
gotoxy(k+34,i+10);
                  
cout<<(char)219;
               }
            }
      }
 
      
cerceve (8,8,42,16);
      
clrscr();
   }while(
true);
 
   
getch();

__________________
aLL Hope iS Gone

aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Alt 04-09-08, 17:24   #22
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

dos ortamında üçgen çizme programı
PHP- Kodu:
#include<iostream>
#include<math.h>
#include<conio.h>
using namespace std;
int main()
{
    
int i,l,k;  
    
cout<<"kenar sayisi :";
    
cin>>l;
    
l=l+1;
    for(
i=0;i<l;i++)   //dikey sayaç
    

     
cout.width(l-i);
    for(
k=0;k<2*i-1;k++)  //yatay sayaç
    
{
      
cout<<"*";
 
    }
    
cout<<endl;
    }
    
getch();
 
    return 
0;

aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Alt 04-09-08, 17:24   #23
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

klavyeden girilen sayının 2 nin üssü olup olmadığını kontrol eden program
PHP- Kodu:
#include<iostream>
#include<math.h>
#include<conio.h>
using namespace std;
int main()
{
    
int a,i;
    
cout<<"sayiyi giriniz: ";
    
cin>>a;
    if(
a<2) {
            
cout<<"2 veya daha buyuk bir sayi giriniz\n";
            return 
main();
            }
    for(
i=0;i<a;i++) if(a==pow(2,i)) {
                     
cout<<"sayi 2 nin katidir.\n";
                     
getch();
                     return 
0;
                     }
 
    for(
i=0;i<a;i++)  if(a!=pow(2,i)) {
                      
cout<<"sayi 2 nin kati degildir.\n";
                      
getch();
                      return 
0;
                      }
    
getch();
 
    return 
0;

aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Alt 04-09-08, 17:25   #24
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

linked list oluşturma örneği...
PHP- Kodu:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define N 5
struct Node{
       
int say;
       
struct Node *next;
};
int main()
{
    
int a,b=0;
    
struct Node *hp=NULL, *tmp,*t2;
 
    
hp=(struct Node *)malloc(sizeof(struct Node));
    if(
hp==NULL)
      return 
0;//hafıza doluysa programı sonlandır
    
t2=hp;
    (
t2->say)=b;
    
b++;
    for(
a=0;a<N;a++){//liste oluşturma
       
tmp=(struct Node *)malloc(sizeof(struct Node));
       if(
tmp==NULL)
           return 
0;//hafıza doluysa programı sonlandır.
       
(t2->next)=tmp;
       (
tmp->say)=b;
       (
tmp->next)=NULL;
        
b++;
        
t2=tmp;  
    }  
    
tmp=hp;
    for(
a=0;(tmp->next)!=NULL;a++){//listeyi ekrana yazma
       
printf("%d-",tmp->say);
       
tmp=(tmp->next);
    }   
   
getch();
   return 
0;

aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Alt 04-09-08, 17:25   #25
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

varolan bir bağlı listeden bir elemanı ( o listede varsa) silen program.örnek listedeki elemanlar 0-1-2-3-4-5-6-7-8-9

Kod:
PHP- Kodu:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define N 10
struct Node{
       
int say;
       
struct Node *next;
};
typedef struct Node dugum;
int eleman_sil(int ndugum **headptr);
int main()
{
    
int a,b=0,c,sil;
    
dugum *hp=NULL, *tmp,*t2;
 
    
hp=(struct Node *)malloc(sizeof(struct Node));
    if(
hp==NULL)
      return 
0;//hafıza doluysa programı sonlandır
    
t2=hp;
    (
t2->say)=b;
    
b++;
    for(
a=0;a<N;a++){//liste oluşturma
       
tmp=(struct Node *)malloc(sizeof(struct Node));
       if(
tmp==NULL)
           return 
0;//hafıza doluysa programı sonlandır.
       
(t2->next)=tmp;
       (
tmp->say)=b;
       (
tmp->next)=NULL;
        
b++;
        
t2=tmp;  
    }
    do{
    
system("cls");
    
printf("hangi rakamı silmek istersiniz?...");
    
scanf("%d",&sil);
    
c=eleman_sil(sil,&hp);    
    }while(
c!=0);
    
tmp=hp;
    for(
a=0;(tmp->next)!=NULL;a++){//listeyi ekrana yazma
       
printf("%d-",tmp->say);
       
tmp=(tmp->next);
    }   
   
getch();
   return 
0;
}
int eleman_sil(int ndugum **headptr)
{
    
int a,sayac=0,c,d=0;
    
dugum *ppp,*temp,*del;
    
ppp=*headptr;  
    for(
a=0;ppp->next!=NULL;a++){
       if(
ppp->say==n){             
          
d=1;
          break;     
       }
       
temp=ppp;
       
ppp=ppp->next;   
    }
    if(
d==0)
       return -
1;
    if(
a==0){
       
del=*headptr;
       *
headptr=(*headptr)->next;
       
free(del);
    }
    else{
         if(
ppp->next==NULL){
            
temp->next=NULL;
         }
         else{
            
temp->next=ppp->next;       
         }
         
free(ppp);
    }
    return 
0

aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Alt 04-09-08, 17:26   #26
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

varolan bir listeden, istenen sıradaki elemanı silen programliste 10 elemanlıdır.
PHP- Kodu:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define N 10
struct Node{
       
int say;
       
struct Node *next;
};
typedef struct Node dugum;
int listeden_sil(int ndugum **headptr);
int main()
{
    
int a,b=0,c,sil;
    
dugum *hp=NULL, *tmp,*t2;
 
    
hp=(struct Node *)malloc(sizeof(struct Node));
    if(
hp==NULL)
      return 
0;//hafıza doluysa programı sonlandır
    
t2=hp;
    (
t2->say)=b;
    
b++;
    for(
a=0;a<N;a++){//liste oluşturma
       
tmp=(struct Node *)malloc(sizeof(struct Node));
       if(
tmp==NULL)
           return 
0;//hafıza doluysa programı sonlandır.
       
(t2->next)=tmp;
       (
tmp->say)=b;
       (
tmp->next)=NULL;
        
b++;
        
t2=tmp;  
    }
    do{
    
system("cls");
    
printf("listenin kacinci elemanini silmek istersiniz?...");
    
scanf("%d",&sil);
    
c=listeden_sil(sil,&hp);    
    }while(
c!=0);
    
tmp=hp;
    for(
a=0;(tmp->next)!=NULL;a++){//listeyi ekrana yazma
       
printf("%d-",tmp->say);
       
tmp=(tmp->next);
    }   
   
getch();
   return 
0;
}
int listeden_sil(int ndugum **headptr)
{
    
int a,sayac=0,c,d;
    
dugum *ppp,*temp,*del;
    
ppp=*headptr;
 
    for(
a=0;ppp->next!=NULL;a++)
       
ppp=ppp->next;
    if(
n<1||n>a)
       return -
1;
    if(
n==1){
       
temp=*headptr;
       (*
headptr)=(*headptr)->next;
       
free(temp);
    }
    else{
         
ppp=*headptr;
 
         for(
a=0;a<n;a++){
            
temp=ppp;
            
ppp=ppp->next;
         }
         
del=ppp;
         if(
ppp->next==NULL)
            
temp->next=NULL;
         else{
            
temp->next=ppp->next;
         }
         
free(del);
    }
    return 
0;

aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Alt 04-09-08, 17:27   #27
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

öğrenci takip programı

PHP- Kodu:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <io.h>
#include <string.h>
 
struct ogrenci {
char adsoy[30];
char k;  //kontrol degiskeni
char tel[15],adres[40],sehir[15],num[10];
}
ogrkay;
 
FILE *dosya;
char cev;
int i,kaysay,say;
char c,ara[10];
 
void giris()
{
clrscr();
dosya=fopen("kayit.dat","a");
printf("OGRENCI NUMARASI ...:");gets(ogrkay.num);
printf("AD VE SOYAD      ...:");gets(ogrkay.adsoy);
printf("ADRES            ...:");gets(ogrkay.adres);
printf("SEHIR            ...:");gets(ogrkay.sehir);
printf("TELEFON NUMARASI ...:");gets(ogrkay.tel);
printf("GIRILEN BİLGİLER DOGRU MU ?...  E/H");
cev=getch();
if (
cev=='E'|| cev=='e') { ogrkay.k='*';
fseek(dosya,filelength(fileno(dosya)),SEEK_SET);
fwrite(&ogrkay,sizeof(struct ogrenci),1,dosya);
flushall();
}
}
 
void baslik()
clrscr();
printf("%-10s%-20s%-25s%-10s%-10s\n\n","NUMARA","AD SOYAD","ADRES","SEHIR","TELEFON");
say=0;
}
 
void listele()
baslik();
kaysay=filelength(fileno(dosya))/sizeof(struct ogrenci);
  for (
i=;i<kaysay;i++) {
fseek(dosya,i*sizeof(struct ogrenci),SEEK_SET);
fread(&ogrkay,sizeof(struct ogrenci),1,dosya);
if (
ogrkay.k=='*')  {
say=say+1;
printf("%-10s",ogrkay.num);
printf("%-20s",ogrkay.adsoy);
printf("%-25s",ogrkay.adres);
printf("%-10s",ogrkay.sehir);
printf("%-10s\n",ogrkay.tel);
if (
say==20) { printf("BIR SONRAKI SAYFA ICIN BIR TUSA BASIN...");
getch(); baslik();
    }
   }
}
printf("\n\n LISTELENECEK KAYITLAR SONA ERDI...");
getch();
}
 
int arama ()
{
clrscr();
printf("ARAMAK ISTEDIGINIZ OGRENCI NUMRASI ...:");gets(ara);
flushall();
  for(
i=;i<kaysay;i++) {
fseek(dosya,i*sizeof(struct ogrenci),SEEK_SET);
fread(&ogrkay,sizeof(struct ogrenci),1,dosya);
if (
strcmp(ara,ogrkay.num)==&& ogrkay.k=='*') {
clrscr();
printf("OGRENCI NUMARASI ...:%s\n",ogrkay.num);
printf("AD VE SOYAD       ...:%s\n",ogrkay.adsoy);
printf("ADRES             ...:%s\n",ogrkay.adres);
printf("SEHIR             ...:%s\n",ogrkay.sehir);
printf("TELEFON NUMARASI  ....:%s\n",ogrkay.tel);
printf("\nCIKIS YAPMAK ICIN LUTFEN BIR TUSA BASINIZ...");
getch(); return 0;
  }
}
printf("ARANAN KAYIT BULUNAMADI...\n");
getch();
return 
0;
}
 
 
int silme (void)
{
clrscr();
printf("SILINECEK OGRECI NUMARASINI GIRIN...:");gets(ara);
  
kaysay=filelength(fileno(dosya))/sizeof(struct ogrenci);
  for (
i=;i<kaysay;i++) {
fseek(dosya,i*sizeof(struct ogrenci),SEEK_SET);
fread(&ogrkay,sizeof(struct ogrenci),1,dosya);
  if (
strcmp(ara,ogrkay.num)==&& ogrkay.k=='*') {
clrscr();
printf("OGRENCI NUMARASI ...:%s\n",ogrkay.num);
printf("AD VE SOYAD       ...:%s\n",ogrkay.adsoy);
printf("ADRES             ...:%s\n",ogrkay.adres);
printf("SEHIR             ...:%s\n",ogrkay.sehir);
printf("TELEFON NUMARASI  ...:%s\n",ogrkay.tel);
printf("\n SILME ISLEMINI GERCEKLESTIRMEK ISTIYOR MUSUNUZ?... E/H");
cev=getch();
if (
cev=='E' || cev=='e'){
ogrkay.k='s';
fseek(dosya,i*sizeof(struct ogrenci),SEEK_SET);
fwrite(&ogrkay,sizeof(struct ogrenci),1,dosya);
  
flushall();
  
printf("\n KAYIT SILME ISLEMI BASARIYLA GERÇEKLESTIRILDI  !");getch();
  return 
0;
     }
    }
}
printf("SILINECEK KAYIT BULUNAMADI...\n");
getch();
return 
0;
}
 
 
 
int duzeltvoid)
{
clrscr();
printf("DUZELTME ISLEMI YAPILACAK OGRENCI NUMARASI...:");gets(ara);
  
kaysay=filelength(fileno(dosya))/sizeof(struct ogrenci);
  for (
i=;i<kaysay;i++) {
fseek(dosya,i*sizeof(struct ogrenci),SEEK_SET);
fread(&ogrkay,sizeof(struct ogrenci),1,dosya);
  if (
strcmp(ara,ogrkay.num)==&& ogrkay.k=='*') {
     do {
     
clrscr();
     
printf("1-OGRENCI NUMARASI ...:%s\n",ogrkay.num);
     
printf("2-AD VE SOYAD      ...:%s\n",ogrkay.adsoy);
     
printf("3-ADRES            ... :%s\n",ogrkay.adres);
     
printf("4-SEHIR            ...:%s\n",ogrkay.sehir);
     
printf("5-TELEFON NUMARASI ...:%s\n",ogrkay.tel);
     
printf("6-KAYIT ÇIKIS      ...\n");
 
     
printf("seçiminiz (1-6):");
     
cev=getch();
     
printf("\n");
     switch (
cev) {
     case 
'1'printf("YENI OGRENCI NUMARASI ...:");gets(ogrkay.num);break;
     case 
'2'printf("YENI AD VE SOYAD      ...:");gets(ogrkay.adsoy);break;
     case 
'3'printf("YENI ADRES            ...:");gets(ogrkay.adres);break;
     case 
'4'printf("YENI SEHIR            ...:");gets(ogrkay.sehir);break;
     case 
'5'printf("YENI TELEFON NUMARASI ...:");gets(ogrkay.tel);break;
     }
     }while (
cev!='6');
     
fseek(dosya,i*sizeof(struct ogrenci),SEEK_SET);
     
fwrite(&ogrkay,sizeof(struct ogrenci),1,dosya);
     
flushall();
     
printf("\n KAYIT DUZELTME ISLEMI BASARIYLA GERCEKLESTIRILDI !");getch();
     return 
0;
     }
    }
    
printf("DUZELTILECEK KAYIT BULUNAMADI...\n");
    
getch();
    return 
0;
    }
 
 
    
void main()
    {
    
dosya=fopen("OGRENCI.DAT","r+b");
    if (
dosya==NULL) {
    
dosya=fopen("OGRENCI.DAT","w+b");
    }
    
textbackground(8);textcolor(2);
    do {
      
clrscr();
      
gotoxy(28,15);printf("<------------------------------->");
      
gotoxy(28,17);printf("* 1-BILGI GIRISI                * ");
      
gotoxy(28,19);printf("* 2-BILGI ARAMA               * ");
      
gotoxy(28,21);printf("* 3-BILGI LISTELEME          * ");
      
gotoxy(28,23);printf("* 4-BILGI SILME                 * ");
      
gotoxy(28,25);printf("* 5-BILGI DUZELTME           * ");
      
gotoxy(28,27);printf("* 6-PROGRAMI SONLANDIR * ");
      
gotoxy(28,29);printf("<------------------------------->");
      
gotoxy(3,50);printf("HAZIRLAYAN...:Kaan DURAN");
      
gotoxy(52,50);printf("SeCiminiz......... (1-6)");
      
c=getch();
      if (
c=='1'giris();
      if (
c=='2'arama();
      if (
c=='3'listele();
      if (
c=='4'silme();
      if (
c=='5'duzelt();
      }while (
c!='6');
      
fclose(dosya);
      } 
aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Alt 04-09-08, 17:27   #28
Dokunma Yanarsın
 
aLayıNaiSyaN - ait Kullanıcı Resmi (Avatar)
 
Üyelik tarihi: 04-02-08
Nerden: . . .
Mesajlar: 1,981
Tecrübe Puanı: 496 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000 aLayıNaiSyaN 1000
Cevap: C++ Örnek Kodlar

basit ama caseler için verilmiş bi ödev

PHP- Kodu:
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
    
int x;
    
int a,b,c;
    
cin>>x;
    
a=100;
    
b=10 10;
    
c=10;
    switch(
a)
    {
            case 
1:  cout<<"Yuz ";break;
            case 
2:  cout<<"Iki Yuz "; break;  
            case 
3:  cout<<"Uc Yuz ";break;
            case 
4:  cout<<"Dort Yuz "; break; 
            case 
5:  cout<<"Bes Yuz ";break;
            case 
6:  cout<<"Alti Yuz "; break; 
            case 
7:  cout<<"Yedi Yuz ";break;
            case 
8:  cout<<"Sekiz Yuz "; break;
            case 
9:  cout<<"Dokuz Yuz "; break;      
    }
    switch(
b)
    {
            case 
0:  cout<<" ";break;
            case 
1:  cout<<"On ";break;
            case 
2:  cout<<"Yirmi "; break;  
            case 
3:  cout<<"Otuz ";break;
            case 
4:  cout<<"Kirk "; break; 
            case 
5:  cout<<"Elli ";break;
            case 
6:  cout<<"Altmis "; break; 
            case 
7:  cout<<"Yetmis ";break;
            case 
8:  cout<<"Seksen "; break;
            case 
9:  cout<<"Doksan "; break;      
    }
    switch(
c)
    {
            case 
0:  cout<<" ";break;
            case 
1:  cout<<"Bir ";break;
            case 
2:  cout<<"Iki "; break;  
            case 
3:  cout<<"Uc ";break;
            case 
4:  cout<<"Dort "; break; 
            case 
5:  cout<<"Bes ";break;
            case 
6:  cout<<"Alti "; break; 
            case 
7:  cout<<"Yedi ";break;
            case 
8:  cout<<"Sekiz "; break;
            case 
9:  cout<<"Dokuz "; break;      
    }
 
    
system("PAUSE");
    return 
0;

aLayıNaiSyaN isimli Üye şimdilik offline konumundadır  
Digg this Post!Bookmark Post in Technorati
Alıntı ile Cevapla
Cevapla

  • Submit Thread to Digg Digg
  • Submit Thread to del.icio.us del.icio.us
  • Submit Thread to StumbleUpon StumbleUpon
  • Submit Thread to Google Google
  • Bookmarks

    Seçenekler
    Stil

    Yetkileriniz
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

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



    Bütün Zaman Ayarları WEZ olarak düzenlenmiştir. Şu Anki Saat: 13:27 .


    Powered by vBulletin Version 3.8.7
    Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
    Search Engine Friendly URLs by vBSEO 3.5.0 RC2
    Sohbet ve Sohbet odalari sitesi

    Sohbet Chat Forum Oyunlar1