NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Dışarıdan girilen bir sayıya kadar olan tüm pozitif sayıların
toplamını bulan program

int main() {
int sayi, sonuc=0;
scanf("%d",&sayi);
for (int i=1; i<=sayi; i++)
{
sonuc+=i;
}
printf("%d", sonuc);
return 0;
}

Dışarıdan girilen iki sayının çarpımını çarpma ya da bölme
operatörü kullanmadan bulan C programını yazınız.
3 x 5
5
5
5

int main() {
int sayi, sayi2, sonuc=0;
scanf("%d",&sayi);
scanf("%d",&sayi2);
for (int i=1; i<=sayi; i++)
{
sonuc+=sayi2;
}
printf("%d", sonuc);
return 0;
}


Programcının önceden belirlediği bir sayıyı kullanıcıdan
tahmin etmesini isteyen ve sayı doğru girilene ardarda sayı
istemeye devam eden C programını yazınız.

int main() {
int sayi=357;
int tahmin;
scanf("%d", &tahmin);
while(tahmin!=sayi)
{
scanf("%d", &tahmin);
}

return 0;
}

int main() {
int sayi=357;
int tahmin;
do
{
scanf("%d", &tahmin);
} while(tahmin!=sayi);

return 0;
}

Önceden tanımlanmış bir matrisin 3. satırını küçükten
büyüğe sıralayarak ekrana yazan C programını yazınız.

int main() {
int matris[5][5];
int mA[3][5]={ {3, 6, 7, 1, 6}, {4, 7, 3, 5, 9}, {1, 5, 8, 2, 6} };
int dizi[5];
for (int i=0; i<5; i++)
{
dizi[i]=mA[2][i];
printf("%dn", dizi[i]);
}
printf("nn");
for (int i=0; i<4; i++)
{
for (int j=i+1; j<5; j++)
{
if (dizi[i]>dizi[j])
{
int gcc=dizi[i];
dizi[i]=dizi[j];
dizi[j]=gcc;
}
}
}
for (int i=0; i<5; i++)
{
printf("%dn", dizi[i]);
}
return 0;
}


math.h kütüphanesinde yer alan abs fonksiyonunun işlevini
yerine getiren kullanıcı tanımlı bir C fonksiyonu yazınız.
Not: hazır fonksiyonlar kullanılarak yapılan çözümler
değerlendirilmeye alınmayacaktır.

int mutlak(int sayi)
{
if (sayi>0) return sayi;
else return sayi*-1;
}


int main() {
int s;
scanf("%d", &s);
int sonuc=mutlak(s);
printf("%d", sonuc);
return 0;
}


Aşağıdaki programın çalıştırılması sonucunda ortaya çıkan
ekran görüntüsünü yazınız.

1. çağrı
1, 1
2. çağrı
2, 0
2, 0
1. çağrı
2, 0

int mustafa(int sayi)
{
printf("%dn", sayi);
printf("%dn", mustafa(sayi-1));
if (sayi<0)
{
return 1;
}
return mustafa(sayi-1);

}

int faktoriyel(int n)
{

if (n==0) return 1;
else
{
printf("%dn", n);
return n*faktoriyel(n-1);
}

}

int f1(int a, int b)
{
printf("%d, %dn", a, b);
if (b>0)
{
f1(++a, --b);
}
printf("%d, %dn", a, b);

}
int main() {
//printf("%d",mustafa(0));
//printf("%d",faktoriyel(5));
f1(3, 5);
return 0;
}


Aşağıdaki şekli dışarıdan girilen sütun sayısına göre
ekrana yazan C programını yazınız.

*****
***
*
*
***
*****


b *
0 5
1 3
2 1
2 1
1 3
0 5

satir=(sutun+1)/2
boşluk=satir
yıldız=sutun-2*satir

*******
*****
***
*
*
***
*****
*******


int main() {
int sutun;
scanf("%d", &sutun);
int satir=(sutun+1)/2;
for (int i=0; i<satir; i++)
{
for (int j=0; j<i; j++)
{
printf(" ");
}
for (int j=0; j<sutun-2*i; j++)
{
printf("*");
}
printf("n");
}

for (int i=satir-1; i>=0; i--)
{
for (int j=0; j<i; j++)
{
printf(" ");
}
for (int j=0; j<sutun-2*i; j++)
{
printf("*");
}
printf("n");
}

return 0;
}

* *
* *
* *
*
*
* *
* *
* *

*******
*** ***
** **
* *
** **
*** ***
*******
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.