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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
WAP – represent a char in binary format 
 Question Submitted By :: Vinayml
I also faced this Question!!     Rank Answer Posted By  
 
  Re: WAP – represent a char in binary format
Answer
# 1
main()

{

        char p = 'a' ;

        int i = 0 ;

 

        for( i = 0 ; i < 8 ; i++)

        ( p & (1 << i )) ?printf ("1"): printf("1");

}

 
 
Is This Answer Correct ?    0 Yes 0 No
Vinayml
 
  Re: WAP &#8211; represent a char in binary format
Answer
# 2
?eh? this doesn't make sense. The answer will obviously be 
11111111.
 
Is This Answer Correct ?    0 Yes 0 No
Johnson
 
 
 
  Re: WAP &#8211; represent a char in binary format
Answer
# 3

   738211
 
Is This Answer Correct ?    0 Yes 0 No
Kalpana.y
 
  Re: WAP &#8211; represent a char in binary format
Answer
# 4
#include <stdio.h>
main()

{

        char p = 'a' ;

        int i = 0 ;



        for( i = 0 ; i < 8 ; i++)

        ( p & (1 << 7-i )) ?printf ("1"): printf("0");

}
 
Is This Answer Correct ?    0 Yes 0 No
Civa
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green") Cadence4
find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); } TCS4
write a program that print itself even if the source file is deleted?  1
Which of the following about automatic variables within a function is correct ? a.its type must be declared before using the variable b.they are local c.they are not initialised to zero d.they are global. TCS3
how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.  1
what is meant by the "equivalence of pointers and arrays" in C? Satyam3
main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); } CitiGroup4
Write a program to interchange two variables without using the third variable? Accenture11
code for copying two strings with out strcpy() function.  5
main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}  3
How can I invoke another program from within a C program?  6
define function Assurgent4
how to convert binary to decimal and decimal to binary in C lanaguage  4
read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX) x=1; else if(x<MIN) x=-1; x=50; if the initial value of x=200,what is the vlaue after executing this code? a.200 b.1 c.-1 d.50 TCS2
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); } TCS6
Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?  1
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }  2
Total of how many functions are available in c?  2
Give a method to count the number of ones in a 32 bit number?  1
Write a program or provide a pseudo code to flip the 2nd bit of the 32 bit number ! (Phone Screen) NetApp1
 
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