Showing posts with label C Programming. Show all posts

C Game


CRORE Pati in 'C' (C Quiz)

This is the One of My 'C' Big Program like Crore pati. In this program it will ask you question about c and if you don't know the answer you can use life-line 3 times. And every true answer you will got some rupees. Enjoy.. !!

*Screen Shots*










*Click for Coding Here*


....Enjoy My Program....

Two Dimension in 'C'



Two Dimension Array in 'C'

This is the C Program of Mine which is my practice of two dimension array.

*Coding Here*


#include<stdio.h>
#include<conio.h>
void main()
{
 clrscr();
 int Matrix[4][6];
 int sum=0,rows,colm;
 printf("This \"Matrix\" has 4 \"rows\" and 5 \"column\"\n\n");
 for(rows=0;rows<=3;rows++)
 {
  for(colm=0;colm<=5;colm++)
  {
   printf("Enter Value for Matrix[%d][%d] : ",rows,colm);
   scanf("%d",&Matrix[rows][colm]);
  }
 }
 clrscr();
 printf("\nThis \"Matrix\" has 4 \"rows\" and 5 \"column\"\n\n\t");
 for(rows=0;rows<=3;rows++)
 {
  for(colm=0;colm<=5;colm++)
  {
   printf("%d\t",Matrix[rows][colm]);
   sum=sum+Matrix[rows][colm];
  }
  printf("\n\t");
 }
 printf("\n\n\t\t ================================");
 printf("\n\t\t  The Sum of all Number is : %d",sum);
 printf("\n\t\t ================================");
 getch();
}


....Enjoy My Program....

Dictionary in 'C'


Dictionary in 'C' Programming

This is the C Program of Mine which is the easy dictionary of FRUITS, DRY FRUITS, VEGETABLES, SPICES

*Coding Here*

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
char a[100];
void name(void);
void programmer(void);
void fruits(void);
void vegetables(void);
void dry_fruit(void);
void spices(void);
void main(void)
{
 clrscr();
 char repeat;
 do
  {
   clrscr();
   programmer();
   gotoxy(1,1);
   name();
   printf("\n\n\n\nEnter word in roman urdu to find its english meaning : ");
   gets(a);
   fruits();
   vegetables();
   dry_fruit();
   spices();
   printf("\n\n\n\n\nDo You have another word to search [Y/N] : ");
   repeat=getch();
  }
  while(repeat=='Y'||repeat=='y');
}
void fruits(void)
{
 if(!strcmpi(a,"Seb"))
   printf("\n\nIn English %s is called : Apple",a);
 else if(!strcmpi(a,"Kharboza"))
   printf("\n\nIn English %s is called : Musk Melon",a);
 else if(!strcmpi(a,"Amrood"))
   printf("\n\nIn English %s is called : Guava",a);
 else if(!strcmpi(a,"Tarbooz"))
   printf("\n\nIn English %s is called : Watermelon",a);
 else if(!strcmpi(a,"Kela"))
   printf("\n\nIn English %s is called : Banana",a);
 else if(!strcmpi(a,"Aam"))
   printf("\n\nIn English %s is called : Mango",a);
 else if(!strcmpi(a,"Papeeta"))
   printf("\n\nThe English Word of %s is : Papaya",a);
 else if(!strcmpi(a,"Khubani"))
   printf("\n\nIn English %s is called : Apricot",a);
 else if(!strcmpi(a,"Aalu bukhara"))
   printf("\n\nIn English %s is called : Damson",a);
 else if(!strcmpi(a,"Injeer"))
   printf("\n\nIn English %s is called : Fig",a);
 else if(!strcmpi(a,"Angor"))
   printf("\n\nIn English %s is called : Grape",a);
 else if(!strcmpi(a,"Nibo"))
   printf("\n\nIn English %s is called : Lemon",a);
 else if(!strcmpi(a,"Aaru"))
   printf("\n\nIn English %s is called : Peach",a);
 else if(!strcmpi(a,"Nashpati"))
   printf("\n\nIn English %s is called : Pear",a);
 else if(!strcmpi(a,"Anannas"))
   printf("\n\nIn English %s is called : Pineapple",a);
 else if(!strcmpi(a,"Aanar"))
   printf("\n\nIn English %s is called : Pomegranate",a);
 else if(!strcmpi(a,"Safar jal"))
   printf("\n\nIn English %s is called : Quince",a);
 else if(!strcmpi(a,"Imli"))
   printf("\n\nIn English %s is called : Tamarind",a);
 else if(!strcmpi(a,"Narangi"))
   printf("\n\nIn English %s is called : Orange",a);
 else if(!strcmpi(a,"Jaman"))
   printf("\n\nIn English %s is called : Black berry",a);
 else if(!strcmpi(a,"Falsa"))
   printf("\n\nIn English %s is called : Grawla aslatica",a);
}
void vegetables(void)
{
 if (!strcmpi(a,"Bhindhi"))
   printf("\n\nIn English %s is called : Lady finger",a);
 else if(!strcmpi(a,"Phali"))
   printf("\n\nIn English %s is called : Bean",a);
 else if(!strcmpi(a,"Chukandar"))
   printf("\n\nIn English %s is called : Beet",a);
 else if(!strcmpi(a,"Began"))
   printf("\n\nIn English %s is called : Bringal or Eggplant",a);
 else if(!strcmpi(a,"Gobi"))
   printf("\n\nIn English %s is called : Cabbage",a);
 else if(!strcmpi(a,"Gajar"))
   printf("\n\nIn English %s is called : Carrot",a);
 else if(!strcmpi(a,"Phol gobi"))
   printf("\n\nIn English %s is called : Cauliflower",a);
 else if(!strcmpi(a,"Ajwain"))
   printf("\n\nIn English %s is called : Celery",a);
 else if(!strcmpi(a,"Makai"))
   printf("\n\nIn English %s is called : Corn or maize",a);
 else if(!strcmpi(a,"Khira" ))
   printf("\n\nIn English %s is called : Cucumber",a);
 else if(!strcmpi(a,"Lehsan"))
   printf("\n\nIn English %s is called : Garlic",a);
 else if(!strcmpi(a,"Piyaz"))
   printf("\n\nIn English %s is called : Onion",a);
 else if(!strcmpi(a,"Matar"))
   printf("\n\nIn English %s is called : Pea",a);
 else if(!strcmpi(a,"Mirch"))
   printf("\n\nIn English %s is called : Pepper",a);
 else if(!strcmpi(a,"Aalu"))
   printf("\n\nIn English %s is called : Potato",a);
 else if(!strcmpi(a,"Loki"))
   printf("\n\nIn English %s is called : Pumpkin",a);
 else if(!strcmpi(a,"Muli"))
   printf("\n\nIn English %s is called : Radish",a);
 else if(!strcmpi(a,"Palak"))
   printf("\n\nIn English %s is called : Spinach",a);
 else if(!strcmpi(a,"Timator"))
   printf("\n\nIn English %s is called : Tomato",a);
 else if(!strcmpi(a,"Shaljam"))
   printf("\n\nIn English %s is called : Turnip",a);
 else if(!strcmpi(a,"Kachalo"))
   printf("\n\nIn English %s is called : Yam",a);
 else if(!strcmpi(a,"Tori"))
   printf("\n\nIn English %s is called : Zucchini",a);
 else if(!strcmpi(a,"Podina"))
   printf("\n\nIn English %s is called : Mint",a);
 else if(!strcmpi(a,"Dhanya"))
   printf("\n\nIn English %s is called : Coriander",a);
 else if(!strcmpi(a,"Sabut dana"))
   printf("\n\nIn English %s is called : Sago",a);
 else if(!strcmpi(a,"Kewra"))
   printf("\n\nIn English %s is called : Pandanus",a);
}
void dry_fruit(void)
{
 if(!strcmpi(a,"Chovara"))
   printf("\n\nIn English %s is called : Dry date",a);
 else if(!strcmpi(a,"Badam"))
   printf("\n\nIn English %s is called : Almond",a);
 else if(!strcmpi(a,"Pista"))
   printf("\n\nIn English %s is called : Pistachio",a);
 else if(!strcmpi(a,"Kishmish"))
   printf("\n\nIn English %s is called : Raisins",a);
 else if(!strcmpi(a,"Akhrot"))
   printf("\n\nIn English %s is called : Chestnut",a);
 else if(!strcmpi(a,"Chilkoza"))
   printf("\n\nIn English %s is called : Pinus gerardlana",a);
 else if(!strcmpi(a,"Kajo"))
   printf("\n\nIn English %s is called : Cashewnut",a);
 else if(!strcmpi(a,"Mum Phali"))
   printf("\n\nIn English %s is called : Groundnut",a);
 else if(!strcmpi(a,"Khajor "))
   printf("\n\nIn English %s is called : Date",a);
}
void spices(void)
{
 if(!strcmpi(a,"Lung"))
   printf("\n\nIn English %s is called : Clove",a);
 else if(!strcmpi(a,"Zira"))
   printf("\n\nIn English %s is called : Cumin",a);
 else if(!strcmpi(a,"Lehsan"))
   printf("\n\nIn English %s is called : Garlic",a);
 else if(!strcmpi(a,"Sunf"))
   printf("\n\nIn English %s is called : Aniseed",a);
 else if(!strcmpi(a,"Kali Mirch"))
   printf("\n\nIn English %s is called : Black pepper",a);
 else if(!strcmpi(a,"Namaq"))
   printf("\n\nIn English %s is called : Salt",a);
 else if(!strcmpi(a,"Dhanya"))
   printf("\n\nIn English %s is called : Coriander",a);
 else if(!strcmpi(a,"Methi"))
   printf("\n\nIn English %s is called : Fenugreek",a);
 else if(!strcmpi(a,"Alsi"))
   printf("\n\nIn English %s is called : Linseed",a);
 else if(!strcmpi(a,"Ilaichi"))
   printf("\n\nIn English %s is called : Cardamom",a);
 else if(!strcmpi(a,"Jaifal"))
   printf("\n\nIn English %s is called : Nutmeg",a);
 else if(!strcmpi(a,"Khameer"))
   printf("\n\nIn English %s is called : Yeast",a);
 else if(!strcmpi(a,"Dar Chini"))
   printf("\n\nIn English %s is called : Cinnamon",a);
 else if(!strcmpi(a,"Zafran"))
   printf("\n\nIn English %s is called : Saffron",a);
 else if(!strcmpi(a,"Supari"))
   printf("\n\nIn English %s is called : Betelnut",a);
 else if(!strcmpi(a,"Sabudana"))
   printf("\n\nIn English %s is called : Sago",a);
 else if(!strcmpi(a,"Shura"))
   printf("\n\nIn English %s is called : Saltpetre",a);
 else if(!strcmpi(a,"Mirch"))
   printf("\n\nIn English %s is called : Chilli",a);
 else if(!strcmpi(a,"Haldi"))
   printf("\n\nIn English %s is called : Turmeric",a);
 else if(!strcmpi(a,"Safed Zira"))
   printf("\n\nIn English %s is called : Cumin seed",a);
 else if(!strcmpi(a,"Sharbat"))
   printf("\n\nIn English %s is called : Syrup",a);
 else if(!strcmpi(a,"Sika kayi"))
   printf("\n\nIn English %s is called : Iriganum",a);
 else if(!strcmpi(a,"Lal Mirch"))
   printf("\n\nIn English %s is called : Red pepper",a);
}
void programmer(void)
{
 gotoxy(52,50);
 printf("An Affort by \"Muhammad Owais\"");
}
void name(void)
{
 printf("\n\n\t\t\t------------------------------");
 printf("\n\t\t\t------------------------------");
 printf("\n\n\t\t\t  Urdu to English Dictionary  ");
 printf("\n\n\t\t\t------------------------------");
 printf("\n\t\t\t------------------------------");
 printf("\n\n\t\tCaintaining the Meanings of FRUITS, VEGETABLES,\n\n\t\t\t      DRY FRUITS and SPICES");
}


....Enjoy Me Program....

C Break and While Loop


While Break in 'C' Programming

This is the C Program which has loop and break statement.

*Coding*

#include<stdio.h>
#include<conio.h>
void main(void)
{
 char a;
 int b=1;
 clrscr();
 a='y';
 while(a=='Y'||a=='y')
  {
   printf("%d",b);
   printf("\nDo You Wish to countinue[Y\N] : ");
   a=getche();
   if(a=='Y'||a=='y')
    {
     a=a;
    }
   else if(a=='N'||a=='n')
    {
     break;
    }
   else
    {
     printf("\n\nFunction Not Found");
     break;
    }
   b=b+1;
   clrscr();
  }
 getch();
}

Formula in 'C'

Formula in 'C' (a+b+c)^2

This is C formula Program. I Simpily made it. I print step by step of formula of this.

*Screen Shot*




C Salary Sheet

C Salary Sheet

This is simple program of salary sheet which ask you to input your basic salary then it'll calculate your gross and net income.



Here is the Code:

#include<stdio.h>
#include<conio.h>
void main()
{
 clrscr();
 float basic_pay,gross_pay,tax;
 printf("\t\t     ***************************");
 printf("\n\t\t\tSalary Sheet");
 printf("\n\t\t ***************************");
 printf("\n\nEnter Your Basic Salary : ");
 scanf("%f",&basic_pay);
 printf("\nConvience Allowness 20%% of Basic Pay : %.f",(0.2*basic_pay));
 printf("\n\nMedical Allowness 10%% of Basic Pay : %.f",(0.1*basic_pay));
 printf("\n\nHouse Rent 5%% of Basic Pay : %.f",(0.05*basic_pay));
 gross_pay=(basic_pay+(0.2*basic_pay)+(0.1*basic_pay)+(0.05*basic_pay));
 printf("\n\n\t\t============================");
 printf("\n\t\t\tGross Pay : %.f",gross_pay);
 printf("\n\t\t============================");
 tax=0.15*basic_pay;
 printf("\n\n\t\t============================");
 printf("\n\t\tTax 15%% of Basic Pay : %.f",tax);
 printf("\n\t\t============================");
 printf("\n\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
 printf("\n\n\t\t\tNet Income : %.f",gross_pay-tax);
 printf("\n\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
 getch();
}

Have Fun...!!!