Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <locale.h>
- #include <conio.h>
- #include <math.h>
- int contquad(int x){
- int n=pow(x,2),y=x;
- while(x<=n){
- if(x==y){
- printf("\n%i ",x);
- }
- else{
- printf("%i ",x);}
- x=x+y;
- }
- }
- int main()
- {
- setlocale(LC_ALL,"portuguese");
- int contlinha,n,numl=-1;
- while(numl<=0){
- system("cls");
- printf("Insira o número de linhas: ");
- scanf("%i",&numl);}
- for(n=1;n<=numl;n++){
- contquad(n);
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement