1 / 9

#include < stdio.h > #include < conio.h > int main() { printf ( "1 2 3 4\n\n" ); // a

Soru1: 1’den 4’e kadar olan tamsayıları ekrana tek satırda görülecek şekilde yazdıran bir programı aşağıdaki metotları kullanarak yazınız. Bir printf ifadesi kullanarak ve hiç format belirteci kullanmadan. Bir printf ifadesi ve dört format belirteci kullanarak.

elu
Download Presentation

#include < stdio.h > #include < conio.h > int main() { printf ( "1 2 3 4\n\n" ); // a

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Soru1: 1’den 4’e kadar olan tamsayıları ekrana tek satırda görülecek şekilde yazdıran bir programı aşağıdaki metotları kullanarak yazınız. Bir printf ifadesi kullanarak ve hiç format belirteci kullanmadan. Bir printf ifadesi ve dört format belirteci kullanarak. Dört printf ifadesi kullanarak. #include <stdio.h> #include <conio.h> int main() { printf( "1 2 3 4\n\n" ); // a printf( "%d %d %d %d\n\n", 1, 2, 3, 4 ); //b printf( "1 " ); //c printf( "2 " ); printf( "3 " ); printf( "4\n" ); getch(); return 0; }

  2. Soru2: Aşağıdaki deseni sekiz printfifadesiyle ekrana yazdıran bir program yazınız. Daha sonra aynısını kullanabileceğiniz en az printf ifadesiyle yazınız.

  3. #include <stdio.h> #include <conio.h> int main() { printf( "Sekizprintf() ifadesiile: \n" ); printf( "* * * * * * * *\n" ); printf( " * * * * * * * *\n" ); printf( "* * * * * * * *\n" ); printf( " * * * * * * * *\n" ); printf( "* * * * * * * *\n" ); printf( " * * * * * * * *\n" ); printf( "* * * * * * * *\n" ); printf( " * * * * * * * *\n" ); printf( "\nSimdiisebirprintf() ifadesiile: \n" ); printf( "* * * * * * * *\n * * * * * * * *\n" "* * * * * * * *\n * * * * * * * *\n" "* * * * * * * *\n * * * * * * * *\n" "* * * * * * * *\n * * * * * * * *\n" ); getch(); return 0; }

  4. Soru3: Kullanıcının iki tamsayı girmesini ve sayıların kullanıcıdan aldıktan sonra bu sayıların toplamlarını, çarpımlarını, farklarını, bölümlerini ve modlarını bulan bir program yazınız. #include <stdio.h> #include<conio.h> int main() { int x; int y; printf( "IkiSayiGiriniz: "); scanf( "%d%d", &x, &y ); printf( "Toplam: %d\n", x + y ); printf( "Carpim: %d\n", x * y ); printf( "Fark: %d\n", x - y ); printf( "Bolum: %d\n", x / y ); printf( "Mod: %d\n", x % y ); getch(); return 0; }

  5. Soru4: Kullanıcıdan bir çemberin yarıçapını alan ve bu çemberin çapını, çevresini, alanını hesaplayan bir program yazınız. π için 3.14159 değerini kullanın. Bütün hesaplamalarınızı kullandığınız printf ifadeleri içinde yaptırın. %f dönüşüm belirtecini kullanın. #include <stdio.h> #include <conio.h> int main() { int radius; printf( "Yaricapigiriniz: " ); scanf( "%d", &radius ); printf( "\nCap: %d\n", 2 * radius ); printf( "Cevre: %f\n", 2 * 3.14159 * radius ); printf( "Alan: %f\n", 3.14159 * radius * radius ); getch(); return 0; }

  6. Soru5: Beş basamaklı bir sayı girişi yapılan, bu sayıyı ayrı ayrı basamaklarına ayıran ve her basamak arasına üç boşluk karakteri koyarak ekrana yazdıran bir program. Not: Tam sayı bölme işlemlerini ve mod operatörünün kullanın. #include <stdio.h> #include <conio.h> int main() { int number; // Kullanıcıtarafındagirileceksayı int temp1; // Birincigecicitamsayı int temp2; // İkincigecicitamsayı printf( "Bes basamaklibirsayigir: " ); scanf( "%d", &number ); printf( "%d ", number / 10000 ); temp2 = number % 10000; printf( " %d ", temp2 / 1000 ); temp1 = temp2 % 1000; printf( " %d ", temp1 / 100 ); temp2 = temp1 % 100; printf( " %d ", temp2 / 10 ); temp1 = temp2 % 10; printf( " %d\n", temp1 ); getch(); return 0; }

  7. Soru6: Sadece bu bölümde öğrendiğiniz programlama tekniklerini kullanarak 0’dan 10’a kadar olan sayıları karelerini hesaplayıp, sonuçları ekrana aşağıda göründüğü biçimde yazdıran bir program yazınız. İpucu: Sonuçları yazarken \t kullanın.

  8. #include<stdio.h> #include<conio.h> int main() { int count = 0; printf( "\nSayi\tKaresi\tKubu\n" ); printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count );

  9. count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); count = count + 1; printf( "%d\t%d\t%d\n", count, count * count, count * count * count ); getch(); return 0;}

More Related