Full Article

SORU: Bir diziyi ters çevren programı yazınız.

#include<stdio.h>
#include<stdlib.h>
#define SIZE 12
void print(int a[]);
int main()
{
int d[SIZE]={52,21,1,65,47,33,12,9,55,44,99,123};
int i,temp;
printf("Dizinin ilk hali\n");
print(d);
for(i=0;i<SIZE/2;i++)
{
temp=d[i];
d[i]=d[SIZE-i-1];
d[SIZE-i-1]=temp;
}
printf("Dizinin ters cevrilmis hali\n");
print(d);
system("pause");
return 0;
}
void print(int a[])
{
int i;
for(i=0;i<SIZE;i++)
printf("%d ",a[i]);

printf("\n\n");
}

 

http://www.homewoodchamber.org/us-history-regents-review-packet/
  • Henüz hiç yorum yok