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

Answer Posted / rajesh

This answer is to print :
4342341234

#include<stdio.h>

int main()
{
int i, space, num, n=4;

for(i=1; i<=n; i++)
{
for(space=1; space<=n-i; space++)
{
}
for(num=space; num<=n; num++)
{
printf("%d",num);
}
}
printf("\n");
}

Is This Answer Correct ?    13 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I learn c++ in a week?

782


Describe the syntax of single inheritance in C++?

842


Does c++ support exception handling?

789


Can I create my own functions in c++?

803


Write my own zero-argument manipulator that should work same as hex?

790


What is the difference between a type-specific template friend class and a general template friend class?

756


How many types of comments are there in c++?

753


How to declaring variables in c++?

865


What's c++ used for?

826


What does scope resolution operator do?

792


Implement stack operations with pointers with appropriate exception checks.

755


Where the memory to the static variables is allocated?

766


Is C++ case sensitive a) False b) Depends on implementation c) True

798


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

1033


Is c++ double?

749