uaveiro-leci/2ano/1semestre/aed/aula01/table1.c

17 lines
316 B
C
Raw Normal View History

#include <math.h>
#include <stdio.h>
int main() {
int lines;
printf("Número de linhas: ");
scanf("%d", &lines);
printf("%5s | %10s | %s \n", "Number", "Square", "Square Root");
for(int i = 1; i<=lines; i++) {
printf("%6d | %10d | %.4f\n", i, i*i, sqrt(i));
}
return 0;
}