Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a c++ program that gives output
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
using looping statement

Answers were Sorted based on User's Feedback



write a c++ program that gives output 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 using looping stateme..

Answer / akhil

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enter limit";
cin>>n;
for(i=1;i<=n;i++)
//cout<<"/n"; for printing line by line
for(j=1;j<=i;j++)
cout<<j;//
getch();
}

Is This Answer Correct ?    18 Yes 1 No

write a c++ program that gives output 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 using looping stateme..

Answer / ramesh.bugatha78

for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
cout<<j;
cout<<"\n";
}

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More C++ General Interview Questions

How can you link a c++ program to c functions?

0 Answers  


Write syntax to define friend functions in C++.

0 Answers   HAL,


What is size of Empty Class?

3 Answers   Persistent,


What is java and c++?

0 Answers  


Why for local variables the memory required to hold the variable is allocated from the program stack and for new its allocated from the heap?

1 Answers  


What is a c++ class?

0 Answers  


What sorting algorithm does c++ use?

0 Answers  


int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

0 Answers  


Write a function to find the nth item from the end of a linked list in a single pass.

0 Answers   Huawei,


What is class in c++ with example?

0 Answers  


What is vector processing?

0 Answers  


Evaulate: 22%5 a) 2 b) 4 c) 0

0 Answers  


Categories