Sunday, 16 December 2012


A=1,B=2,C=3,..........         C A T=3+1+20=24


#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<conio.h>
void main()
{
  char a[100];int i,l=0,b[100],s=0;
  printf("\nEnter word: ");
  gets(a);
  l=strlen(a);
  for(i=0;i<l;i++)
 
{
 if(isupper(a[i]))
  b[i]=a[i]-64;                 /*ASCII value of capital A is 65.So for A to be 1 subtract 64*/
 if(islower(a[i]))
  b[i]=a[i]-96;                 /*ASCII value of small a is 97.So for a to be 1 subtract 96*/
 printf("\n%c : %d",toupper(a[i]),b[i]);
 }
printf("\n   _____");

 for(i=0;i<l;i++)
  s=s+b[i];
printf("\n    %d",s);
printf("\n   _____");
getch();
}
Download source and exe here



Do want  to run mobile phone java apps and games in computer??

2.Install it.Click Start --> All Programs-->SjBoy Special Edition - ChingLish 1.00-->Start SjBoy
3.click File-->Open and choose the desired jar file

Sjboy running Opera Mini
A Game running in Sjboy
For more info.Go to http://shal.wen.ru/mostwanted/sjboynew.xhtml


Bored????
How to create 2000 folders in a single stroke???
Type the following in Turbo C++ and run. You will find the exe file in TC\BIN\.
If your C program file is Noname00.c,then exe file is Noname00.exe

#include<stdio.h>
void main()
{
 FILE *f1;                                                     /*Declaring file pointer*/
 int i;
 f1=fopen("folder.bat","w");             /*Create new file named folder.bat*/
 for(i=0;i<2000;i++)                            /*for loop to be executed 2000 times*/
//As printf prints on screen, fprintf prints in a file
 fprintf(f1,"\nmkdir F%d",i);             /*print in the file mkdir F0,mkdir F1 line by line in the batch file*/
 system("folder.bat");                          /*Execute the batch file*/
}
The program folder.c

Creation of folders in process



Ok created 2000 folders …….How to remove them??
Replace the line fprintf(f1,"\nmkdir F%d",i);          by          fprintf(f1,"\nrmdir F%d",i);
In short replace mkdir by rmdir.
Compile and run in Turbo C++ and run the exe file as done before……

And all folders created will removed quickly….
Folder.bat


Right click the folder.bat and select edit you will find the contents.We exploited for loop to print in file F0,F1,etc……….
NOTE:   mkdir-make directory(folder)
                rmdir-remove directory
                Lines starting with // and text enclosed with /*,*/are comments.They need not be typed in the    program.

Friday, 14 December 2012


//C program to calculate GPA
#include<stdio.h>
#include<conio.h>

main()

{

 char a[8];float b;int i;int n[8];char c;
 start:
 clrscr();

 printf("\nCopyright(c)2012 Winston\n\n\nEnter the Grades in this Order.\neg:cdeacaed\nCY2111     Chemistry");

 printf("\nGE2111     EG      ");

 printf("\nGE2112     FOCP     ");

 printf("\nGE2115     CP    ");

 printf("\nGE2116     EP       ");

 printf("\nHS2111     English ");

 printf("\nMA2111     Maths  ");

 printf("\nPH2111     Physics  ");

 printf("\nEnter Grades:");
 scanf("%s",a);

 for(i=0;i<8;i++)                        /*Checking each character*/

  {

   if(a[i]=='s') n[i]=10;

   if(a[i]=='a') n[i]=9;

   if(a[i]=='b') n[i]=8;

   if(a[i]=='c') n[i]=7;

   if(a[i]=='d') n[i]=6;

   if(a[i]=='e') n[i]=5;

  }
  //The grades points are multiplied by credits and summed up
  b=n[0]*3+n[1]*5+n[2]*3+n[3]*2+n[4]*2+n[5]*4+n[6]*4+n[7]*3;

  printf("GPA %0.2f",b/26);        /*Dividing by total number of credits,%0.2f for two decimal points */
  printf("\nPress c to continue or any key to exit");
  c=getche();
  if(c=='c') goto start;
  getch();

}





I did this during the time of my first semester results
Very useful for bulk calculation of GPA.
Download the source code and the executable here.GPA-calculator
 

Merry Christmas

Advance Christmas Wishes