Skip to content

Instantly share code, notes, and snippets.

@pasali
Created October 8, 2012 21:35
Show Gist options
  • Save pasali/3855146 to your computer and use it in GitHub Desktop.
Save pasali/3855146 to your computer and use it in GitHub Desktop.
#include<stdio.h>
void main()
{
int neg = 0, poz = 0;//
int s=0;
int d;
loop:
{
scanf("%d",&d);
s++;
if(d < 0)
neg = neg + d;
else
poz = poz + d;
if(s<10) goto loop;
}
printf("Pozitif toplam = %d\nNegatif toplam = %d\n", poz, neg);
}
#include<stdio.h>
#include<math.h>
void main()
{
int s1;
int s2;
scanf("%d%d",&s1,&s2);
printf(Geo ort = %.1f",sqrt(s1 + s2);
}
#include<stdio.h>
void main()
{
printf("Santigrad => Fahrenayt [0]\nFahrenayt => Santigrad [1]\n");
int secim;
scanf("%d",&secim);
if (secim ==0){
printf("Santigrad girin = ");
int sant;
scanf("%d",&sant);
float fahr = (float) 1.8 * sant +32;
printf("%.1f\n", fahr);
}
else if(secim == 1){
printf("Fahrenayt girin = ");
int fahr;
scanf("%d",&fahr);
float sant = (float) 5/9 *(fahr-32);
printf("%.1fC\n",sant);
}
else
printf("Hatalı seçim !!!");
}
#include<stdio.h>
void main()
{
int neg = 0, poz = 0;// Burda negatif ve pozitif sayısını tutacak değişkenleri tanımladık
int s=0;
int d;
loop:
{
scanf("%d",&d);
s++;
if(d < 0)
neg++;
else
poz++;
if(s<10) goto loop;
}
printf("Pozitif = %d\nNegatif = %d\n", poz, neg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment