#include <stdio.h>
#include <conio.h>
main()
{
int a[10],b[10],i,s,c,z,k,u=1;
printf(”10 tane ar ardina sayi yazilacak ve sonra yazilan sayiya en yakin olani bununacaktir\n”);
for(i=0;i<10;i++)
{printf(”\n%d inci sayi=”,i+1);
scanf(”%d”,&a[i]);
}
printf(”\nproblem sayi=”);
scanf(”%d”,&s);
for(i=0;i<10;i++)
{b[i]=a[i]-s;}
for(i=0;i<10;i++)
{if(b[i]<0)
{b[i]=b[i]-2*b[i];}}
for(i=0;i<10;i++){
for(c=1;c<10;c++)
{if(b[i]>b[c])
{z=b[c];
b[c]=b[i];
b[i]=z;
k=a[i]; Read the rest of this entry »
#include<stdio.h>
#include<conio.h>
int matrisa[3][3]={5,2,7,4,9,6,7,4,1};
int matrisb[3][3]={6,7,4,9,8,2,3,4,9};
int carpmatris[3][3]={0,0,0,0,0,0,0,0,0};
int i,j;
int main(){
for (i=0;i<3;i++){
for (j=0;j<3;j++){
carpmatris[i][j]=matrisa[i][j]*matrisb[i][j];
}
}
for (i=0;i<3;i++){
for (j=0;j<3;j++){
printf(”%d “,carpmatris[i][j]);
}
printf(”\n\n\n”);
#include<iostream>
using std::cout;
using std::cin;
using std::endl;
#include<iomanip>
using std::setw;
#include<ctime>
int isPresent(int * arr, int uBound , int v)
{
int i = 0 ;
while( i < uBound)
{
if (*(arr+i) == v )
return i;
i++;
}
return -1;
}
int main()
{
int a=0,b[6];
srand(time(0));
cout<<endl<<endl<<setw(40)<<”SAYISAL LOTO”<<endl<<endl<<setw(46)<<” Created by UMUT ULUS “<<endl<<endl;
cout<<setw(50)<<” Programi kapatmak icin -1 girin “<<endl<<endl;
int v ;
int j;
while(a!=-1)
{
cout<<setw(50)<<” Programi kapatmak icin -1 girin “<<endl;
cout<<setw(44)<<” Kac kolon oynayacaksin ? : “;
cin>>a;
cout<<endl<<endl;
for(int i=1;i<=a;i++)
{
for(j = 0;j<6;j++)
{
v = rand()%49+1;
while( isPresent(b,j,v) >= 0 )
v = rand()%49+1;
b[j] = v;
}
cout<<setw(18)<<i<<”. Kolon : “<<setw(5);
for(int l=0;l<6;l++)
{
cout<<setw(5)<<b[l];
}
cout<<endl<<endl<<endl;
}
}
return 0;
}