Relacion Lab 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

]

Universiteti Politeknik i Tiranës

Fakulteti i Inxhinierisë Matematike dhe Fizike

Dega: Inxhinieri Matematike

Lënda: Bazat e informatikws

Punë Laboratori
1

Punoi : Helena PARANGONI Pranoi: Dr. Teuta MYFTIU


Ushtrimi 1+2:
 Lexoni tre vlera dhe tregoni a formojnë trekëndësh me gjatësi brinjësh këto 3 vlera,gjej
perimetrin.

#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);
}

You might also like