You are here:

C/Need For a Solution

Advertisement


Question
respected sir,
i am anirban paul,from jamshedpur,i have two question  could u please tell me the answer?
1)what is the source code of this tringle program
               A
             A N I
           A N I R B
         A N I R B A N
2)WHAT IS SOURCECODE OF THIS PROGRAM
                 1
               2 3 4
             5 6 7 8 9
                    
  3)             1
               1 1 1
             2 2 2 2 2
           3 3 3 3 3 3 3
         4 4 4 4 4 4 4 4 4

Answer
Dear Anirban Paul!
  
 Since my time is limited i have no time to develop solution for all your questions , yen here im presenting you solution for the 1st ( of course bit complicated than the other 2 )
Note : You can follow the same strategies with minor modification to develop similar solutions .

#include<stdio.h>
void main()
{
  char * str = "ANIRBAN";
  int i , j , k , l , n;

  n = (strlen(str) / 3) +1;
  for( i = 0  , k = n ; i <= strlen(str); i+=2 , k--)
  {
     for( l = 0 ; l<=k ; l++)
        printf(" ");
     for( j = 0 ; j <= i ; j++)
        printf("%c" , *(str+j));
     printf("\n");
  }

}

If you have doubts feel free to post a follow  up !
Thanks and Regards !
Prince M. Premnath.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.