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
If errno contains a nonzero number, is there an error?
What are the benefits of organizational structure?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
Explain how can you tell whether two strings are the same?
Disadvantages of C language.
How can you determine the size of an allocated portion of memory?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
What are formal parameters?
What is bss in c?
What is wrong with this code?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What is the function of this pointer?
What is quick sort in c?
Write a C program to count the number of email on text
Which control loop is recommended if you have to execute set of statements for fixed number of times?