program to print this triangle
*
* *
* * *
Answers were Sorted based on User's Feedback
Answer / rajesh
#include<stdio.h>
main()
{
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=i;j++)
printf(""+"*",i,j);
}
}
| Is This Answer Correct ? | 8 Yes | 58 No |
Answer / jayasreesampath
#include<stdio.h>
main()
{
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
printf("\n",i,j);
}
}
| Is This Answer Correct ? | 23 Yes | 91 No |
Define a program that reads two matrices of size 3x3 with real values from the user then prints their sum, difference and multiplication.
Explain shallow copy?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
How can I improve my c++ skills?
Live example for static function?
In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest.
Why do we use classes in c++?
Write a C++ Program to check whether a number is prime number or not?
#include<iostream.h> void main() { class x { public: int func(int) { cout<<"cool"; return 1; } } }
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
What is a conversion constructor?
Differentiate between a constructor and a method in C++.