Friday, September 9, 2011

Malloc Implementation

Below is a program enter any integer either positive, negative or zero upto so many times you want and when you've to stop then enter 01.
The program will count number of positive,negative and zeros among the numbers you've given in your program.

#include "stdio.h"
#include "stdlib.h "
main() {
int p=0,q=0,z=0,*pt;

while(1) {
printf("note : press 01 to exit \n Enter any number : ");
pt=(int*)malloc(1*2);
scanf("%d",pt);
if(*pt==01)
break;
if(*pt > 0)
p++;
if(*pt < 0)
q++;
if(*pt==0)
z++;
}
printf("you have entered \n positive = %d , negative = %d , zeros = %d",p,q,z);
}

Compile online RUN offline!

Wednesday, September 7, 2011

Any Base to Any Base conversion in C

This program is able to convert any base from any base you want and the most interesting feature is that  it can convert numbers which have fractional part too.
No program on the Internet till date can provide you such features.
Below is a link which will get you to the source code download page of this program.
Just download it and then copy that named conversi.c file  to the tc\bin\ folder and open your IDE and goto open and type there conversi.c and after that just press ctrl+F9 to run.
output :
Enter a number 43.25

Enter its base 6
Enter the base to be converted : 4
Decimal value = 27
Converted value 123
converted value with fractional part 123.1


conversi.c http://www.4shared.com/file/oY5-zj_k/conversi.html
or download the exe file conversi.exe


r u unable to understand this program??????????TRY THESE






1. Email us at chelperr@gmail.com



2. Post your question in the comment box.



3. You can give us your email ID also.



4. If you want to ask a program/topic or wanted introduce any discussion topic then just email at chelperr@gmail.com or drop a comment in the comment box.