ambarisha.kn 15 Junior Poster in Training
/*decimal to binary*/
#include <stdio.h>

void printBinary(const unsigned char val) {

  for(int i = 7; i >= 0; i--)

    if(val & (1 << i))

     printf("1");

    else

      printf("0");
  printf("\n");

} 

int main() {
	int dec;
	int hold=0;
	printf("Integer number : ");
	scanf("%d",&dec);
	printBinary((unsigned char)dec);	
}
Hiroshe commented: 1. Don't give away free code. 2. That code is bad. -1
ambarisha.kn 15 Junior Poster in Training

If you can't figure out code tags after 60+ posts, what makes you think kernel programming is for you?

who the hell are you, you are not the person to speak about ability.
Ofcourse i am not brillinat than you, but u have some manners.
First learn how to behave.

If you dont know manners, your knowledge is waste.

I know how to use tags, but in hurry i have not used tags.
Thats it.

If you know answer reply to the post else dont blame others.
I think For this purpose u made 5000+ posts.

Salem commented: I couldn't give a shit about the code if you can't be arsed to use code tags. -7
ambarisha.kn 15 Junior Poster in Training

I want to read all files in a particular folder using C programming. HOw to do this. Thanks.

Ex: I have some 5 files in folder named c:\temp.
I want to read all files one after another and want to write output file for each input file.
The output files has to be saved in another folder named c:\output

How to do this. Plz any one give me suggestion how to start