Yeni Microsoft Word Document - C++ Sorular ve Cevaplar 1....

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: C++ Sorular ve Cevaplar 1. genin alann bulan alt program yaznz... #include<stdio.h> #include<conio.h> void alanhes(int t,int h) { int alan=((t*h)/2); printf("alan=%d",alan); } void main(){ int t,h; clrscr(); printf("tabani giriniz..:\n"); scanf("%d",&t); printf("yksekligi giriniz...:\n"); scanf("%d",&h); alanhes(t,h); getch(); } 2. Yaznn Byk harf veya kk harfle yazmasn salayan program? #include<stdio.h> #include<ctype.h> #include<conio.h> main() { clrscr(); char str[80]; int i; char *ptr; ptr=str; printf("Buyuk harflerle bir cumle giriniz"); gets(str); /* gets (karekterdizisi)\0*/ while(*ptr) printf("%c",tolower(*ptr++)); /* tolower("HASAN")*/ printf("Buyuk harflerle\n"); ptr=&str[0]; while(*ptr) printf("%c",toupper(*ptr++)); /* toupper(degisken) */ getch(); } 3. Silindirin hacmini alan program yaznz... #include <stdio.h> #include <conio.h> #define Pi 3.14 float hacimal(int r,int h){ float hacmi=Pi*r*r*h; return hacmi;} void main(){ clrscr(); int yaricap,yukseklik; printf("R ve H yi giriniz "); scanf("%d %d",&yaricap,&yukseklik); printf("Hacim = %f",hacimal(yaricap,yukseklik)); getche(); } 4. Bir saynn karesini ve kpn bulan program yaznz? #include<stdio.h> #include<conio.h> main(){ int karevekup[100][3]; int i,sayigir; for(i=0;i<100;i++){ karevekup [0]=i+1; karevekup[1]=(i+1)*(i+1); karevekup[2]=(i+1)*(i+1)*(i+1); } do{ printf(" 1 ile 100 aras 0 nda bir say 0 giriniz"); scanf("%d",&sayigir); for(i=0;i<100;i++){ if(sayigir==karevekup[0]){ printf("Girilen %d say 0 s 0 n 0 n karesi= %d ve K 0 p 0 = %d\n",sayigir,karevekup[1],karevekup[2]); } } }while(sayigir!=0); getch(); } 5. Bir iinin alt saat,ad,numaras ve maan bulan program yaznz.. #include <stdio.h> #include<math.h> #include<stdlib.h> #include<conio.h> char ad[5] [80] ; char tn[5] [20]; int saat [5] ; long maas[5] ; int menu(); void rapor(); void enter(); main() { clrscr(); int sec; do{ sec=menu(); switch(sec) { case 0: break; case 1: enter (); break; case 2: rapor(); break; default: printf("yeniden deneyiniz"); } }while(sec!=0); getche(); } int menu() { char str[80]; int i; printf("\n"); printf("0- cikis\n"); printf("1-bilgi girisi\n"); printf("2 bilgi okuma\n"); printf("\n seciminizi giriniz:"); gets(str); i=atoi(str);...
View Full Document

Page1 / 10

Yeni Microsoft Word Document - C++ Sorular ve Cevaplar 1....

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online