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
Differentiate between new and malloc(), delete and free() ?
Explain how to reverse singly link list.
What are type modifiers in c?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
What are pointers? What are stacks and queues?
How many bytes is a struct in c?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is extern variable in c with example?
What is fflush() function?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
What is the role of && operator in a program code?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
What is the value of h?
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
Why shouldn’t I start variable names with underscores?