• Streams & Subjects

    Streams & Subjects

    Get detailed description of each and every topic with proper examples including text, images and videos.

  • Latest Technologies

    Latest Technologies

    Know more about the latest and new emerging technologies and boost your knowledge.

  • Programming

    Programming

    Don't learn just codes and syntax, instead learn the best and efficient way of coding.

  • Technologies

    New Technologies

    Get instant and relevant updates of the latest emerging technologies of lots of streams including web, clouds, virtualization, etc.

  • Freewares

    Freewares

    Download free trials and freewares of various fields and check out their efficiency before buying.

  • Multimedia

    Multimedia

    Learn techniques to design amazing and creative multimedia designs and characters including 2D & 3D layout with rendering.

C Programming

C Programming


Equilateral Triangle Number Design

Posted: 05 Sep 2013 10:12 AM PDT

Q. Write a C program to print the following equilateral triangle number design as:

     5
    454
   34543
  2345432
 123454321

Ans.

/*c program for equilateral triangle design*/
#include<stdio.h>
int main()
{

 int num,r,c,sp,n;
 printf("Enter no. of rows : ");
 scanf("%d", &num);
 for(r=1; r<=num; r++)
 {
  for(sp=num-r; sp>=1; sp--)
     printf(" ");
  for(n=num-r+1; n<=num; n++)
     printf("%d",n);
  for(c=1,n=num-1; c<r; c++,n--)
     printf("%d",n);
  printf("\n");
 }
 getch();
 return 0;
}

The output of above program would be:


Output of Equilateral Triangle design C program
Figure: Screen shot for Equilateral Triangle design C program


Z-Shape Pyramid

Posted: 05 Sep 2013 08:18 AM PDT

Q. Write a C program to print the Z-Shape pyramid as:

******
    *
   *
  *
 *
******

Ans.

/*c pyramid program for z-shape*/
#include<stdio.h>
int main()
{

 int num,r,c,sp,n;
 printf("Enter no. of rows : ");
 scanf("%d", &num);
 for(r=1; r<=num; r++)
    printf("*");
 printf("\n");
 for(r=1,n=num-1; r<=num-2; r++,n--)
 {
  for(sp=1; sp<n; sp++)
     printf(" ");
  printf("*");
  printf("\n");
 }
 for(r=1; r<=num; r++)
    printf("*");
 printf("\n");
 getch();
 return 0;
}

The output of above program would be:

Output of Z-Sahpe pyramid C program
Figure : Screen shot for Z-Shape pyramid C program

Number Triangle

Posted: 05 Sep 2013 07:01 AM PDT

Q. Write a C program to print the following number triangle as:

     1
    21
   321
  4321
 54321

Ans.

/*c program for number pyramid*/
#include<stdio.h>
int main()
{

 int num,r,c,sp;
 printf("Enter no of rows : ");
 scanf("%d", &num);
 for(r=1; r<=num; r++)
 {
  for(sp=num-r; sp>=1; sp--)
     printf(" ");
  for(c=r; c>=1; c--)
     printf("%d",c);
  printf("\n");
 }
 getch();
 return 0;
}

The output of above program would be:


Output of number triangle C program
Figure : Screen shot for number triangle C program



Read more

9lessons:Create Custom Facebook Application

9lessons:Create Custom Facebook Application

Link to 9lessons Programming Blog

Create Custom Facebook Application

Posted: 03 Sep 2013 12:14 PM PDT

Facebook fan page is the most required thing for your brand or website to reach more people via social. Facebook Pages by default applications for Photos, Videos and Events, if you would like to add custom pages with other information like product Look Book, Offers, etc. This post explains you to how to create an application for Facebook Fan page, take a quick look at the following steps.

Create Custom Facebook Application

Read more »


Read more

C Programming

C Programming


Increased Number Triangle

Posted: 01 Sep 2013 04:44 AM PDT

Q. Write a C program to print the following Increased Number Triangle as:

    5
   45
  345
 2345
12345

Ans.

/*c program for increased number triangle*/
#include<stdio.h>
int main()
{

 int num,r,n,sp;
 printf("Enter no. of rows : ");
 scanf("%d", &num);
 for(r=1; r<=num; r++)
 {
  for(sp=num-r; sp>=1; sp--)
     printf(" ");
  for(n=num-r+1; n<=num; n++)
     printf("%d",n);
  printf("\n");
 }
 getch();
 return 0;
}

The output of above program would be:

Output of Increased Number Triangle C program
Figure: Screen-shot for Increased Number Triangle C program


Decreased Number Triangle

Posted: 01 Sep 2013 03:58 AM PDT

Q. Write a C program for decreased number triangle as:

5
54
543
5432
54321

Ans.

/*c program for decreased number triangle*/
#include<stdio.h>
int main()

{
 int num,r,c,n;
 printf("Enter no. of rows : ");
 scanf("%d", &num);
 for(r=1; r<=num; r++)
 {
   for(c=1,n=num; c<=r; c++,n--)
       printf("%d",n);
   printf("\n");
 }
 getch();
 return 0;
}

The output of above program would be:

Output of Decreased Number Triangle C program
Figure: Screen-shot for Decreased Number Triangle C program



Half-Square Number Triangle

Posted: 01 Sep 2013 03:10 AM PDT

Q. Write a C program to print the following half-square number triangle C program as : 

543212345
 4321234
  32123
   212
    1

Ans.

/*c program for half-square number triangle*/
#include<stdio.h>
int main()
{
 int num,r,c,n,sp,p;

 printf("Enter any number : ");
 scanf("%d", &num);
 for(r=1,n=num; r<=num; r++,n--)
 {
   for(sp=r; sp>1; sp--)
      printf(" ");
   for(c=r,p=n; c<=num; c++,p--)
      printf("%d",p);
   for(c=num-r,p=2; c>=1; c--,p++)
      printf("%d",p);
   printf("\n");
 }
 getch();
 return 0;
}

The output of above program would be:


Output of Half-Square Number Triangle C program
Figure :  Screen shot for Half-Square Number Triangle C program


Odd-Number Triangle

Posted: 01 Sep 2013 02:39 AM PDT

Q. Write a C program to print the following odd-number triangle C program as:

135
11111
33333
55555

Ans.

/*c program for odd number triangle*/
#include<stdio.h>
int main()
{

 int num=5,r,c,p;
 //as num=5 is given 
 for(r=1,p=1; r<num-1; r++,p=p+2)
    printf("%d",p);
 printf("\n");
 for(r=1,p=1; r<num-1; r++,p=p+2)
 {
  for(c=1; c<=num; c++)
     printf("%d",p);
  printf("\n");
 }
 getch();
 return 0;
}

The output of above program would be:

Output of odd number triangle C program
Figure : Screen shot for odd number triangle C program


V-Shape Pyramid

Posted: 01 Sep 2013 02:08 AM PDT

Q. Write a C program to print the following V symbol star pyramid as:

*     *
 *   *
  * *
   *

Ans.

/*c pyramid program for v-symbol*/
#include<stdio.h>
int main()
{

 int num=4,r,c,sp;
 for(r=1,c=num+1; r<=num; r++,c=c-2)
 {
   for(sp=r; sp>1; sp--)
      printf(" ");
   printf("*");
   for(sp=c; sp>=1; sp--)
      printf(" ");
   if(c>=1)
      printf("*");
   printf("\n");
 }
 getch();
 return 0;
}

The output of above program would be:


Output of V-Shape C pyramid program
Figure : Screen shot for V-Shape pyramid C program




Read more