piramide
C
int i, j, n, asteriscos, espacios;
/*
n: 6
asteriscos espacios
.....*..... 1 5
....***.... 3 4
...*****... 5 3
..*******.. 7 2
.*********. 9 1
*********** 11 0
espacios = de n - 1 a 0 de 1 en 1
asteriscos = de 1 a n - 1 de 2 en 2
*********
*******
*****
***
*
*/
n = 6;
espacios = n - 1;
asteriscos = 1;
for(i = 1; i <= 2*n; i++){
for(j = 1; j <= espacios; j++){//espacios
printf(".");
}
for(j = 1; j <= asteriscos; j++){ //asteriscos
printf("*");
}
if(i < n){//estamos en la mitad superior
espacios--;
asteriscos = asteriscos + 2;
}else{//estamos en la mitad inferior
espacios++;
asteriscos = asteriscos - 2;
}
printf("\n");
}
Also in C:
- Title
- Difference between ** and *
- Category
- C
- Title
- c defined value sum
- Category
- C
- Title
- duplicar cadena
- Category
- C
- Title
- atoi
- Category
- C
- Title
- how to put a struct in another struct C
- Category
- C
- Title
- read files in c
- Category
- C
- Title
- how to go to top of file in vim
- Category
- C
- Title
- c bit access union
- Category
- C
- Title
- xamarin command listview button
- Category
- C
- Title
- Declaring Variables in C
- Category
- C
- Title
- cantidad de digitos recursiva
- Category
- C
- Title
- reset style matplotlib
- Category
- C
- Title
- /usr/bin/mandb: fopen /var/cache/man/7935: Permission denied
- Category
- C
- Title
- enum c
- Category
- C
- Title
- '&&' within '||'
- Category
- C
- Title
- how to ascii art in c
- Category
- C
- Title
- tar cmd
- Category
- C
- Title
- vbl share price
- Category
- C
- Title
- how to put quotes inside string c
- Category
- C
- Title
- factors using recursion
- Category
- C
- Title
- c program to perform transpose of a matrix
- Category
- C
- Title
- sleep in c programming
- Category
- C
- Title
- entete
- Category
- C
- Title
- link whatsapp to website
- Category
- C
- Title
- how to remove \n from a string c
- Category
- C
- Title
- accessing elements 2D array using pointers
- Category
- C
- Title
- how to open a website in c
- Category
- C
- Title
- mediawiki upload size
- Category
- C
- Title
- what is strikethrough in markdown
- Category
- C
- Title
- c concatenate strings
- Category
- C
- Title
- conda windows 10 from pip._internal.cli.main import main ModuleNotFoundError
- Category
- C
- Title
- \0 in c
- Category
- C
- Title
- passing 2d array as parameter to function in c
- Category
- C
- Title
- california
- Category
- C
- Title
- c float to int
- Category
- C
- Title
- generate all permutations of string
- Category
- C
- Title
- c check if char is an operator
- Category
- C
- Title
- C largest unsigned int
- Category
- C
- Title
- calculate max of three numbers using ternary operator in c
- Category
- C
- Title
- qtableview get selected row
- Category
- C
- Title
- how to mutex lock in c
- Category
- C
- Title
- does strcat null terminate
- Category
- C
- Title
- accessing elements of 1d array using pointers
- Category
- C
- Title
- command line coursera
- Category
- C
- Title
- pointer parameter where to put the asterix in C?
- Category
- C
- Title
- oop244
- Category
- C
- Title
- code wars responsable drinker
- Category
- C
- Title
- es palindromo
- Category
- C
- Title
- for loop c
- Category
- C
- Title
- hostbuilder add environment variables
- Category
- C
- Title
- c program to find the sum of given number
- Category
- C
- Title
- classification report to excel
- Category
- C
- Title
- objective c swizzle method
- Category
- C
- Title
- primo
- Category
- C
- Title
- how to feed a char array to function in C
- Category
- C
- Title
- arduino digital input pins
- Category
- C
- Title
- how to free memory in c
- Category
- C
- Title
- command line arguments c
- Category
- C
- Title
- linux directory commands
- Category
- C
- Title
- java.lang.SecurityException: Permission denied (missing INTERNET permission?)
- Category
- C
- Title
- msdos
- Category
- C
- Title
- declare variable in c
- Category
- C
- Title
- c zero out array
- Category
- C
- Title
- v
- Category
- C
- Title
- restapi
- Category
- C
- Title
- entete c/c++
- Category
- C
- Title
- heitai bestial
- Category
- C
- Title
- arduino digital read
- Category
- C
- Title
- how to rebasde
- Category
- C
- Title
- read from stdin c
- Category
- C
- Title
- error: ‘istringstream’ is not a member of ‘std’
- Category
- C
- Title
- confirm sweet alert
- Category
- C
- Title
- powershell search big files
- Category
- C
- Title
- diferencia entre * y & en c
- Category
- C
- Title
- how to print in c
- Category
- C
- Title
- concatenate two strings in c
- Category
- C
- Title
- ModuleNotFoundError: No module named 'tensorboardX'
- Category
- C
- Title
- declare character array statically?
- Category
- C
- Title
- docker logs follow
- Category
- C
- Title
- Gemfile.lock`. It is likely that you need to grant write permissions for that path.
- Category
- C
- Title
- scanf read line
- Category
- C
- Title
- jock cranley
- Category
- C
- Title
- slug urls django
- Category
- C
- Title
- 233 pounds to inr
- Category
- C
- Title
- c isdigit function
- Category
- C
- Title
- incompatible types when initializing type ‘float’ using type ‘point {aka struct point}’
- Category
- C
- Title
- select all file from date powershell
- Category
- C
- Title
- what is size_t in c
- Category
- C
- Title
- reset c array to zero
- Category
- C
- Title
- hopw to check how many duplicates in an array c
- Category
- C
- Title
- múltiplos entre dos numeros en c
- Category
- C
- Title
- printf("%3d ",XX);
- Category
- C
- Title
- double return type in c
- Category
- C
- Title
- declaring a volatile in c
- Category
- C
- Title
- CL/cl.h: No such file or directory
- Category
- C
- Title
- c array
- Category
- C
- Title
- how to comment in arduino
- Category
- C
- Title
- measure time in c
- Category
- C
- Title
- -> operator
- Category
- C
- Title
- bash: apt-add-repository: command not found
- Category
- C