hi folks,

plz try sending answers to folllowing questions....i know they are a lot..still...send as many as possible.....

Write a "Hello World" program in 'C' without using a semicolon.

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

C/C++ : Exchange two numbers without using a temporary variable.

C/C++ : Find if the given number is a power of 2.

C/C++ : Multiply x by 7 without using multiplication (*) operator.


C/C++ : Write a function in different ways that will return f(7) = 4 and f(4) = 7

Remove duplicates in array

Finding if there is any loop inside linked list.

Remove duplicates in an no key access database without using an array

Convert (integer) number in binary without loops.

Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed.

From a 'pool' of numbers (four '1's, four '2's .... four '6's), each player selects a number and adds it to the total. Once a number is used, it must be removed from the pool. The winner is the person whose number makes the total equal 31 exactly.

Swap two numbers without using a third variable.

Given an array (group) of numbers write all the possible sub groups of this group.

Ummm. Do your own work

Write a "Hello World" program in 'C' without using a semicolon

Who comes up with these brilliant ideas?

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

puts("5 9 2 37");

These are all numbers from 1 to 100 and 100 to 1, and I'm printing them.

questions 3 and 13 are identical. Both questions use undefined behavior of data overflow, so results will also be undefined.

Write a "Hello World" program in 'C' without using a semicolon.

Not possible.

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

use recursion

Write a "Hello World" program in 'C' without using a semicolon.

#include <stdio.h>

int main()
{
	while( !printf( "%s", "Hello World\n" ) )
	{
	}
}

C/C++ : Write a function in different ways that will return f(7) = 4 and f(4) = 7

int f ( int x )
{
       if ( x == 7 )
      {
            return 4;
      }
      if ( x == 4 )
      {
            return 7;
      }
}

:cheesy:

Ok -- so it can be done.

hmmm. It compiled with the Visual Studio 8 Compiler ( 2005 Beta ). Maybe you are using the wrong file extention ( remember it says in C ).
This was my command to compile

cl /EHsc main.c

edit: I checked without the /EHsc switch. that also works.

cl main.c

hmmm. ...

I deleted my previous objection -- my error.

questions 3 and 13 are identical. Both questions use undefined behavior of data overflow, so results will also be undefined.

They are not identical. (And I'm not telling you why! Nya ha ha!) :mrgreen:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.