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...

program for following output using for loop?
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Answer Posted / jayaraj.s

#include <stdio.h>
main()
{
int a,b;
for(a=1;a<=5;a++)
{
printf("\n%d",a);
for(b=1;b!=a;b++)
{
printf("%d",a);
}
}
getch();
}

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scanf () in c?

1177


What is the correct code to have following output in c using nested for loop?

1125


What is getch?

1282


How can you avoid including a header more than once?

1025


Why does everyone say not to use scanf? What should I use instead?

1476


What is file in c language?

1052


What is dynamic memory allocation?

1391


Why header files are used?

1169


In c language can we compile a program without main() function?

1179


can we implement multi-threads in c.

1181


Explain how do you search data in a data file using random access method?

1177


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

1205


Describe the order of precedence with regards to operators in C.

1105


Is malloc memset faster than calloc?

1133


What are the different types of constants?

1132