NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

1)Dışarıdan girilen bir cümledeki her kelimenin son harfini ekrana yazan c kodu
int main(int argc, char** argv) {
char isim[100];
gets(isim);
char n=0;
for(int i=0; isim[i]!=''; i++)
{
if(isim[i]==' ') printf("%c", isim[i-1]);
n=i;
}
printf("%c", isim[n]);
return 0;
}

2)10 elemanlı tanımlı bir dizideki en büyük ve en küçük elemanların
indis numarasını ekrana yazan c kodunu for döngüsü kullanmadan yapınız.
int dizi[10]={0,1,2,3,4,5,6,7,8,9};
int enb=dizi[0];
int enk=dizi[0];
int i=0;
while(i!=10)
{
if(dizi[i]>enb) enb=i;
if(dizi[i]<enk) enk=i;
i++;
}
printf("%d-%d", enb, enk);
return 0;
}


3)kullanıcı tarafından girilen 10 elemanlı bir diziyi dizi1 e atayan daha
sonra o elemandaki sayıları dizi2 ye tersten aktarıp dizi1 ile dizi2
nin her indisindeki elemanların kareleri farkını dizi3 e aktaran
c kodunu yazınız.

int main(int argc, char** argv) {
int dizi1[10];
int dizi2[10];
int dizi3[10];
for(int i=0; i<=9; i++)
{
scanf("%d", &dizi1[i]);
}
int n=9;
for(int i=0; i<=9; i++)
{
dizi2[i]=dizi1[n];
n--;
}
for(int i=0; i<=9; i++)
{
dizi3[i]=(dizi1[i]*dizi1[i])-(dizi2[i]*dizi2[i]);
}
for(int i=0; i<=9; i++)
{
printf("%dn", dizi3[i]);

}

return 0;
}

4)bir dosyadaki öğrenci numarası vize notu ve final notunu başka bir dosyaya
vizenin yüzde 40 ı finalin yüzde 60 ını alıp öğrenci numarasıyla kaydeden
c kodu

FILE *dosya, *dosya1;

int a,b,c;
char no[30];
dosya=fopen("ogrenci.txt","r");
dosya1=fopen("ogrenci1.txt","w");
while(feof(dosya)==0)
{
fscanf(dosya,"%s %d %d", no, &a, &b);
c=(0.4*a)+(0.6*b);
fprintf(dosya1, "%s %d", no, c);

}
fclose(dosya);
fclose(dosya1);
     
 
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.