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
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What is register variable in c language?
How main function is called in c?
What is a macro?
What is the condition that is applied with ?: Operator?
What is the difference between text and binary modes?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is unsigned int in c?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
I need previous papers of CSC.......plz help out by posting them.......
What is the difference between procedural and declarative language?
Explain the difference between getch() and getche() in c?
Can we increase size of array in c?
What is a volatile keyword in c?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent