Professional Documents
Culture Documents
Relacion Lab 1
Relacion Lab 1
Relacion Lab 1
Punë Laboratori
1
#include<stdio.h>
int main(void)
{
int a,b,c;
printf("\nLexo a=");
scanf("%d",&a);
printf("\nLexo b=");
scanf("%d",&b);
printf("\nLexo c=");
scanf("%d",&c);
if((a<b+c)&&(b<a+c)&&(c<a+b))
printf("\nFormohet trekendesh me perimeter%d\n",a+b+c);
else
printf("\nNuk formon trekendesh\n");
}
Ushtrimi 3
Gjej mesataren e 5 vlerave te plota.
#include<stdio.h>
int main(void)
{
float a,b,c,d,e;
printf("\nLexo a=");
scanf("%f",&a);
printf("\nLexo b=");
scanf("%f",&b);
printf("\nLexo c=");
scanf("%f",&c);
printf("\nLexo d=");
scanf("%f",&d);
printf("\nLexo e=");
scanf("%f",&e);
printf("\nMesatarja=%.2f",(a+b+c+d+e)/5);
}
Ushtrimi 4:
Gjej shumën e n numrave cift natyror.
#include<stdio.h>
int main(void)
{
int S=0,i=2,N;
printf("\nLexo N=");
scanf("%d",&N);
while (i<=(2*N))
{
S=S+i;
i=i+2;
}
printf("\nShuma=%d\n",S);
}
Ushtrimi 5:
#include<stdio.h>
int main(void)
{
int S=0,a;
printf("\nLexo a=");
scanf("%d",&a);
while(a!=0)
{
S=S+a%10;
a=a/10;
}
printf("\nShuma=%d",S);
}