Showing posts with label All Stars Programs with solution using C.... ... Show all posts
Showing posts with label All Stars Programs with solution using C.... ... Show all posts

Friday, July 8, 2011

All Stars Programs with solution using C.... ..

  1. Write a C program to print the following pattern:
2.  *
3.        *  *
4.     *  *  *
5.  *  *  *  *

By Gulshan Arora
  1. Write a C program to print the following pattern:
7.  *                   *
8.  * * *           * * *
9.  * * * * *   * * * * *
10.* * * * * * * * * * *

By Gulshan Arora
  1. Write a C program to print the following pattern:
12.*                         *
13.   *                   *
14.*     *             *     *
15.   *     *       *     *
16.*     *      *      *     *
17.   *     *       *     *
18.*     *             *     *
19.   *                   *
20.*                         *
  1. Write a C program to print the following pattern:
22.*   *   *   *   *
23.  *   *   *   *
24.    *   *   *
25.      *   *
26.        *
27.      *   *
28.    *   *   *
29.  *   *   *   *
30.*   *   *   *   *
  1. Write a C program to print the following pattern:
32.*
33.        * * *
34.      * * * * *
35.    * * * * * * *
36.  * * * * * * * * *
37.    * * * * * * *
38.      * * * * *
39.        * * *
40.          *
41.        * * *
42.      * * * * *
  1. Write a C program to print the following pattern:
44.*
45.       * *
46.         * * *
47.           * * * *
48.         * * *
49.       * *
50.     *
  1. Write a C program to print the following pattern:
52.* * * * * * * * *
53.* * * *   * * * *
54.* * *       * * *
55.* *           * *
56.*               *
57.* *           * *
58.* * *       * * *
59.* * * *   * * * *
60.* * * * * * * * *
  1. Write a C program to print the following pattern:
62.* * * * * * * * * * * * * * * * *
63.  * * * * * * *   * * * * * * *
64.    * * * * *       * * * * *
65.      * * *           * * *
66.        * * * * * * * * *
67.          * * * * * * *
68.            * * * * *
69.              * * *
70.                *
  1. Write a C program to print the following pattern:
72.*
73.    * * *
74.  * * * * *
75.* * * * * * *
76.*           *
77.* *       * *
78.* * *   * * *
79.* * * * * * *
80.* * *   * * *
81.* *       * *
82.*           *
83.* * * * * * *
84.  * * * * *
85.    * * *
86.      *
  1. Write a C program to print the following pattern:
88.* * * * * * * * * * * * * * * * * * * * * * * * *
89.  *           *   *           *   *           *
90.    *       *       *       *       *       *
91.      *   *           *   *           *   *
92.        *               *               *
93.      *   *           *   *           *   *
94.    *       *       *       *       *       *
95.  *           *   *           *   *           *
96.* * * * * * * * * * * * * * * * * * * * * * * * *
  1. Write a C program to print the following pattern:
*
      *  *
   *  *  *
*  *  *  *
Program:
/* This is a simple mirror-image of a right angle triangle */

#include
int main() {
 char prnt = '*';
 int i, j, nos = 4, s;
 for (i = 1; i <= 5; i++) {
for (s = nos; s >= 1; s--) {  // Spacing factor
   printf("  ");
  }
  for (j = 1; j <= i; j++) {
   printf("%2c", prnt);
  }
  printf("\n");
  --nos;   // Controls the spacing factor
 }
 return 0;
}
  1. Write C program to print the following pattern:
3.  *                   *
4.  * * *           * * *
5.  * * * * *   * * * * *
* * * * * * * * * * *
Program:
#include
int main() {
 char prnt = '*';
 int i, j, k, s, c = 1, nos = 9;
 for (i = 1; c <= 4; i++) {
     // As we want to print the columns in odd sequence viz. 1,3,5,.etc
  if ((i % 2) != 0) {
   for (j = 1; j <= i; j++) {
 printf("%2c", prnt);
}
for (s = nos; s >= 1; s--) { //The spacing factor
    if (c == 4 && s == 1) {
     break;
    }
    printf("  ");
   }
   for (k = 1; k <= i; k++) {
    if (c == 4 && k == 5) {
     break;
    }
    printf("%2c", prnt);
   }
   printf("\n");
   nos = nos - 4;  // controls the spacing factor
   ++c;
  }
 }
 return 0;
}
  1. Write C program to print the following pattern:
7.  *                         *
8.     *                   *
9.  *

AngularJS Basics - Part 1

                                                                  AngularJS What is AngularJS ·          Framework by googl...