Category: Computer

C programming code to display asterisk in diagonal pattern

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to display asterisk in diagonal pattern where the length of the diagonal is given by n Code #include<stdio.h> #include<conio.h> void main() { clrscr(); int n,col,row; printf(“Enter the number\n”); scanf(“%d”,&n); for(int i=1;i<=n;i++) { for(int j=1;j<2n;j++) {

C programming code to display asterisk in X pattern

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to display asterisk in X pattern where the length of X is given by n Code #include<conio.h> #include<stdio.h> void main() { int n,i,j; clrscr(); printf(“Enter the value of n”); scanf(“%d”,&n); for(i=1;i<=n;i++) { printf(“\n”); for(j=1;j<=n;j++) {

C programming code to display asterisk in a right angle triangle

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to display asterisk in a right angle triangle below left diagonal Code #include<stdio.h> #include<conio.h> void main() { clrscr(); int n; printf(“Enter the number\n”); scanf(“%d”,&n); for(int i=1;i<=n;i++) { for(int j=1;j<=i;j++) { printf(“*”); } printf(“\n”); } getch();