Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

52.write a “Hello World” program in “c” without using a
semicolon?
53.Give a method to count the number of ones in a 32 bit number?
54.write a program that print itself even if the source file
is deleted?
55.Given an unsigned integer, find if the number is power of 2?

Answer Posted / sainath

A small correction in the above answer. Use if condition as
shown below.

#include<stdio.h>
void main()
{
if(printf(%s, "Hello World"))
{
}
}


Answer for the last ques. i.e no. 55

unsigned int x;
if(x < 0) //Error checking only. Unsigned int shudn't
//have a negative value
return 0;
else
return !(x $ (x-1));

The logic here is, if we do bitwise 'and' with two
consecutive numbers, the greater of which is a power of 2
then the answer is 0.
Eg. 8 - 1000
8-1 - 0111
and & - 0000

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is null defined in c?

1102


Wt are the Buses in C Language

3152


What is the difference between memcpy and memmove?

968


Can we declare function inside main?

947


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1954


Explain how can a program be made to print the line number where an error occurs?

1148


What is New modifiers?

1061


Write a program to show the change in position of a cursor using c

997


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

1018


Explain modulus operator. What are the restrictions of a modulus operator?

970


When is a void pointer used?

1192


Why #include is used in c language?

994


Why do we use namespace feature?

1009


Why do we use int main?

1043


What are reserved words?

1046