Friday 20 January 2012

Simple Programs in C

Let us now write down our second C program.It would simply calculate simple interest for a set of values representing principle,number of years and interest.
/*Calculating of simple interest*/
#include<stdio.h>
#include<conio.h>
int main()
{
int p,n;
float r,si;
p=1000;
n=3;
r=8.5;
/*formula for simple interest*/
si=p*n*r/100;
printf("%f\n",si);
return 0;


Friday 13 January 2012

Simple Program in C

C programming language has conditions and loops also.Usually we are writing a program,and then  Preprocesser header files and then logics are given next step is closing functions and run a program.Some simple programs are compile with out loops and conditions.The hard programs that is using functions are don't run without using conditions and looping concepts also.So that is why we are using conditions as well as
loops.
        /*The simple program with out using any conditions and loops*/
            #include<stdio.h
         #include<conio.h>
         main()
         {
         int a,b,c;                                        //declaring variables
         clrscr();                                          //clearing the output screen
         printf("enter the value of a and b");  //formatted output statement
         scanf("%d%d",&a,&b);                      //formatted input statement
         c=a+b;                                           //a and b are added and stored in c
         printf("%d",c);                                //variable c is printed
         getch();
         }
In this program we are declaring variables a and b and c.And then get the values from the user and b.And the operator + will be used then two values are added and stored in variable c.<printf>and <scanf> functions are called formatted output and formatted input functions.Logical operator(+)is used in this program.The print the c value.The output will be displayed as follows:
enter the values and b 5,6
c=11




     






Thursday 12 January 2012

C programming Character Set

A character denotes any alphabets,digit or special symbol used to represent information.
Some special character set are allowed in C language.Those are primary character set and secondary character set.
                                   *Integer constants 
                            *Real constants
                            *float constants  are available in C language
And then the secondary constants are user defined functions
User defined functions are as follows
                            *Structures
                            *Unions
                            *enumerators 
These are vital part of user defined functions and other user defined functions also available in C.

Wednesday 11 January 2012

C programming Short cut keys



Short cut keys for C:   To compile the C program we are using------>Ctrl+F9
                                 To run the C program using we are using------>Alt+F9
To edit the program need to use these methods:                             
                                   Ctrl+A : Selects all brushes and entities in the level
                                   Ctrl+D : Deselect all selected brushes and entities
To using File Operations
                                   Ctrl+N : Create a new file  
                                  Ctrl+O : Open an existing file
                                  Ctrl+S : Save file
To using commands and command lines: 
                          F1 : Help
                          Left arrow : Select previous face or brush
                          Right arrow : Select next face or brush
                          F6 : Go to next pane
                          Shift+F6 : Go to previous pane
                          Keypad + : Zoom in
                          Keypad - : Zoom out
                          X : Lock X axis
                          Y : Lock Y axis
                          Z : Lock Z axis
                          Enter : Add template brush/entity to level
                          N : Make current brush newest
                          Page Down : Toggle between brush mode and face mode

 


Tuesday 10 January 2012

Introduction about C


C is a procedure oriented language and also it is called structured programming language. C is developed at AT& T's Bell Laboratories of USA in 1972.It was written and designed by Dennis Ritchie.C is not a case sensitive language and also easy to compile with the compiler.An opinion that is often heard today is -"C has already superceded by languages like C++,C# and JAVA also,So why bother to learn C today".Since C provides several languages elements that makes the interactions feasible without compromising the performance it is preferred choice of the programmer
 
Communicating with a computer involves speaking the language the computer understands, Which immediately rules out English as the language of the communication with computer. In C we are using the more operators and operands also.And firstly we have write header files that is<#include<stdio.h>>. And then using the another header file that is<#include<conio.h>>. Then the next step is main() funcion.We need to declaring main() function.Because without a main() function the statments would not be executed.And C has two types of parts that are Declaration part and the Executable part.We are declaring the variables in the Declaration part and executing the variables in the Executable part