write a c++ program that gives output
4
3 4
2 3 4
1 2 3 4 using looping statement
Answer Posted / rajesh
4
3 4
2 3 4
1 2 3 4
#include<stdio.h>
int main()
{
int i, j, n=4;
for(i=n; i>=1; i--)
{
for(j=i; j<=n; j++)
{
printf("%d",j);
}
printf("\n");
}
printf("\n");
}
| Is This Answer Correct ? | 32 Yes | 1 No |
Post New Answer View All Answers
Define copy constructor.
What is virtual destructor? What is its use?
Comment on local and global scope of a variable.
Write a c program for binary addition of two 8 bit numbers.
What is the difference between #define debug 0 and #undef debug?
In a function declaration, what does extern mean?
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include why and when we can declar member fuction as a private in
the class? What are c++ tokens? Explain terminate() and unexpected() function? Write some differences between an external iterator and an internal iterator? what kind of projects are suitable for c and c++ What is the sequence of destruction of local objects? What is ctime c++? What is the difference between the parameter to a template and the parameter to a function?