Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int i,j,m,n;
- printf("Unesite pozitivan cijeli neparan broj: ");
- scanf("%d",&m);
- if(m%2==0)
- {
- printf("Broj nije neparan");
- }
- else
- if((m<0)||m==0)
- {
- printf("Broj nije pozitivan");
- }
- else if((m%2==1) && (m>0))
- {
- for(i=0;i<m;i++)
- {
- for(j=0;j<m;j++) {
- if((i==j)||(m==(i+j)+1)||(j==(m/2))||(i==(m/2)))
- printf("*");
- else
- printf(" ");
- }
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment