Web Based Perl script to Find Factorial of a Number!
This is a basic Web-based Perl Script that helps school and college students to improve their knowledge in Perl Scripting. […]
This is a basic Web-based Perl Script that helps school and college students to improve their knowledge in Perl Scripting. […]
Let’s write a JavaScript program to print Even Numbers within a given range. First, to find an Even number it
Let’s write a JavaScript program to print Odd Numbers within a given range. First, to find an Odd number it
In this post, we are going to see how to write a PHP program to print leap years between two
Hi Students, let’s write another pattern program in C language! Print Diamond star pattern using C program:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
#include <stdio.h> int main() { int limit, space, i, j; //print a string about the program printf("C Program to print diamond pattern\n"); printf("Enter the limit: "); //get the limit scanf("%d", &limit); //print the first half of the pyramid space = limit; for (i = 1; i <= limit; i++) { for (j = 1; j <= space; j++) { printf(" "); } space--; for (j = 1; j <= 2 * i - 1; j++) { printf("*"); } printf("\n"); } //print the second half of the pyramid space = 2; for (i = 1; i <= limit; i++) { for (j = 1; j <= space; j++) { printf(" "); } space++; for (j = 1; j <= 2 * (limit - i) - 1; j++) { printf("*"); } printf("\n"); } } |
Sample Output
Hello reader, here is a Python programme to find an entered number is odd or even. This programme could be
Let’s see an interesting program for school/college students who are learning core Java. To find whether an entered number is
Hello Perl language learners, school/college students here is another interesting program that will help you to understand the basic concepts of Perl
Let’s write a simple Perl program to find leap year, very useful for beginners and school / college students, Formula
Hello C language lovers, school/college students here is another interesting program that will help you to understand the basic concepts of C