adspace


Write a C++ program without using any loop (if, for, while
etc) to print numbers from 1 to 100 and 100 to 1;

Answer Posted / sandy

#include<iostream>
int i;
class A
{
public:
A(){cout<<i++<<endl;}
~A(){cout<<--i<<endl;}
}
int main()
{
A a[100];
return 0;
}

Is This Answer Correct ?    41 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between null pointer and void pointer.

1160


Is int a keyword in c?

1059


develop algorithms to add polynomials (i) in one variable

2261


hi send me sample aptitude papers of cts?

2252


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2829


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2216


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1944


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1617


ATM machine and railway reservation class/object diagram

5337


write a program to find out prime number using sieve case?

2176


write a c program to find the sum of five entered numbers using an array named number

2248


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

2006


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2516


How do you determine the length of a string value that was stored in a variable?

1205


write a progrmm in c language take user interface generate table using for loop?

2124