program to print this triangle
*
* *
* * *

Answer Posted / mayank murari

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for(i=1;i<4;i++)
{
for(j=4;j>=i;j--)
{
printf(" ");
}
for(k=1;k<2*i;k++)
{
printf("*");
}
printf("\n");
}

getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you write a function similar to printf()?

866


Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h

863


Which software is used to run c++ program?

720


which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?

949


Difference between pass by value and pass by reference?

838


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

952


What is pure virtual function?

814


What is near, far and huge pointers? How many bytes are occupied by them?

873


Why do we use pointers in c++?

769


What is void pointer in c++ with example?

803


How would you obtain segment and offset addresses from a far address of a memory location?

821


Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

742


What is stoi in c++?

909


Explain the difference between new() and malloc() in c++?

835


How can you differentiate between inheritance and implementation in c++?

877