AllC Programing LanguageUncategorizedWordpress Tutorials

#include<stdio.h> int main() { int i, n, j; printf("Enter number of lines: "); scanf("%d", &n); /* Upper part of diamond */ for(i=1;i<=n;i++) { for(j=1;j<=n-i;j++) { printf(" "); } for(j=1;j<=2*i-1;j++) { printf("*"); } printf("\n"); } /* Lower part of diamond patter */ for(i=n-1;i>=1;i--) { for(j=1;j<=n-i;j++) { printf(" "); } for(j=1;j<=2*i-1;j++) { printf("*"); } printf("\n"); } return...

#include<stdio.h> int main() { int i, j, n, a,b,c,d; printf("Enter n: "); scanf("%d", &n); /* Some Setup */ a=1; b=1; c=n; d=n; /* Pattern */ for(i=1;i<=2*n-1;i++) { for(j=1;j<=2*n-1;j++) { if(i==n) { a<=n?printf("%d",a++):printf("%d",--c); } else if(i+j==2*n) { a<=n?printf("%d",b++):printf("%d",--d); } else { printf(" "); } } printf("\n"); } return 0; } Output  Enter n: 6 1 1...

#include<stdio.h> int main() { int i, j, n, a,b,c,d; printf("Enter n: "); scanf("%d", &n); /* Some Setup */ a=1; b=1; c=n; d=n; /* Pattern */ for(i=1;i<=2*n-1;i++) { for(j=1;j<=2*n-1;j++) { if(i==n) { a<=n?printf("%d",a++):printf("%d",--c); } else if(j==n) { a<=n?printf("%d",b++):printf("%d",--d); } else { printf(" "); } } printf("\n"); } return 0; } Output Enter n: 5 1 2...

#include int main() { int i, n, j; printf("Enter number of lines: "); scanf("%d", &n); /* Upper part of diamond */ for(i=1;i<=n;i++) { for(j=1;j<=n-i;j++) { printf(" "); } for(j=1;j<=2*i-1;j++) { j==1||j==2*i-1?printf("*"):printf(" "); } printf("\n"); } /* Lower part of diamond patter */ for(i=n-1;i>=1;i--) { for(j=1;j<=n-i;j++) { printf(" "); } for(j=1;j<=2*i-1;j++) { j==1||j==2*i-1?printf("*"):printf(" "); } printf("\n");...

#include<stdio.h> void triangleShape(int n); void flagPole(int n); int main() { int row; printf("Enter number of rows: "); scanf("%d", &row); triangleShape(row); triangleShape(row); flagPole(row); return 0; } void triangleShape(int n) { int i,j; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { printf("* "); } printf("\n"); } } void flagPole(int n) { int i; for(i=1;i<=n;i++) { printf("*\n"); } } Output Enter number...

#include<stdio.h> int main() { int i, j, n; printf("Enter n: "); scanf("%d", &n); /* Pattern */ for(i=1;i<=2*n-1;i++) { for(j=1;j<=2*n-1;j++) { if(i==n || j==n) { printf("*"); } else { printf(" "); } } printf("\n"); } return 0; } Output Enter n: 10 * * * * * * * * * ******************* * * * *...

https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
About
Products
Subscribe

If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

    Applauz

    As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

    Subscribe

    If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

      Applauz

      As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

      Copyright by BOLD THEMES. All rights reserved.