ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
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?
 Question Submitted By :: Avula_sujatha@yahoo.co.in
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
Hi Sujatha,

Program for your question no.52.

#include<stdio.h>
main()
{
   if(Printf("Hello World!!!"))
}
Here I didn't use semicolon, I hope I met your criteria.
 
Is This Answer Correct ?    27 Yes 18 No
Devarathnam .c, S.v.university
 
  Re: 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
# 2
write a �Hello World� program in �c� without using a
semicolon?

#include<stdio.h>
main()
{
   if(printf("Hello World \n"))
        {
        }
}

This will work perfectly.
 
Is This Answer Correct ?    36 Yes 5 No
V.srinivasan
 
 
 
  Re: 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
# 3
53.another possible answer
count=0;
num; //32 bit integer
hex =0x01;
for(i=0;i<32;hex<<1,i++)
       if(hex&num)
          count++;
 
Is This Answer Correct ?    3 Yes 3 No
Cpd
[Wallaby]
 
  Re: 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
# 4
write a �Hello World� program in �c� without using a
semicolon?

#include<stdio.h>
int main()
{
while(!(printf("%s \n","hello world!!!")));
{
}
return(0);
}
 
Is This Answer Correct ?    0 Yes 6 No
Sanjay
 
  Re: 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
# 5
54:
you can load the source file to memory at the beginning of
the run using mmap(), or using one of the countless methods
to read from file in C and storing the data in a string
array, then it won't matter if the file is deleted, you can
always re-create it using the data in the process memory.

53/55: answering 53 also answers 55.

53: 
int checkBits(x){
numOfOnes=0;
do{
if((x%2)!=0)
 {numOfOnes++;}
x=x/2;
}while (x!=0);

return numOfOnes;
}

55:
int checkPower(x){
if(checkBits(x)==1)
 {return 1;}
else{return 0;}
}
 
Is This Answer Correct ?    1 Yes 1 No
G
 
  Re: 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
# 6
hi yash 
#include<stdio.h>
int main()
{
 while(printf("hello")){}
}
 
Is This Answer Correct ?    0 Yes 0 No
Yash
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
6. Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod() Accenture1
The C language terminator is a.semicolon b.colon c.period d.exclamation mark TCS3
write a programme that inputs a number by user and gives its multiplication table.  2
11. Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage Accenture7
implement general tree using link list Wipro1
What is the difference between typeof(foo) and myFoo.GetType()?  1
what is link list?  2
What is the purpose of Scanf Print, getchar, putchar, function?  2
what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above Accenture2
Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?  1
how to copy a string without using c function  5
write a program that finds the factorial of a number using recursion?  1
can we print any string without using terminator? Infosys2
#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? } NDS9
How do I declare a pointer to an array?  5
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program TCS12
In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?  4
to find out the reverse digit of a given number Infosys5
please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i); printf("%d",i); getch(); }  3
What is the Difference between Macro and ordinary definition? Motorola2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com