<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0' gd:etag='W/&quot;DEUNRX85fCp7ImA9WhVSFk8.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545</id><updated>2012-03-13T01:11:34.124-07:00</updated><title>tautorials</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default?redirect=false&amp;v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry gd:etag='W/&quot;DEUNRX8-eCp7ImA9WhVSFk8.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-2121089493514182491</id><published>2012-03-13T01:11:00.000-07:00</published><updated>2012-03-13T01:11:34.150-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-13T01:11:34.150-07:00</app:edited><title>Preprocessor and Macro</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title"&gt;    Preprocessor and Macro           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T02:28"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;pre&gt;#include
#define VAL 40
#undef VAL
#define VAL 40
main()
{
    printf ("%d\n", VAL);
}&lt;/pre&gt;&lt;pre&gt;file1.h
#define USD 1
file2.h
#define UKP 1
file3
#include
#include “file1.h”
#ifdef USD
       #define currency_rate 46
#endif
#ifdef UKP
   #define currency_rate 100
#endif
main()
{
    int rs;
    rs = 10 * currency_rate;
    printf ("%d\n", rs);
}&lt;/pre&gt;&lt;pre&gt;file1.h
#define USD 1
file2.h
#define UKP 1
file3
#include
#include
#if (defined (USD))
     #define currency_rate 46
#elif (defined (UKP))
     #define currency_rate 100
#else
     # define currency_rate 1
#endif
main()
{
    int rs;
    rs = 10 * currency_rate;
    printf ("%d\n", rs);
}&lt;/pre&gt;&lt;pre&gt;#include
#include "preprop2.h"
#if !defined (USD) || !defined (UKP)
#error "ERROR: NO_CURRENCY rate is specified."
#endif
main()
{
    int rs;
    rs = 10 * currency_rate;
    printf ("%d\n", rs);
}&lt;/pre&gt;&lt;pre&gt;&lt;strong&gt;Macro in C Programming&lt;/strong&gt;&lt;/pre&gt;&lt;pre&gt;#define CUBE(x)  x*x*x
#include
main ()
{
    int k = 5;
    int j = 0;
    j = CUBE(k);            //j = k*k*k
    printf ("value of j is %d\n", j);
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-2121089493514182491?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/2121089493514182491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/preprocessor-and-macro.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/2121089493514182491?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/2121089493514182491?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/preprocessor-and-macro.html' title='Preprocessor and Macro'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DEYDQHg6eCp7ImA9WhVSFk8.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-4564496930648020965</id><published>2012-03-13T01:09:00.002-07:00</published><updated>2012-03-13T01:09:31.610-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-13T01:09:31.610-07:00</app:edited><title>File in C</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title"&gt;    File in C           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T02:21"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Files in C Programming&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&amp;nbsp; File Operations&lt;br /&gt;
&lt;ol start="1"&gt;&lt;li&gt;Opening a File&lt;/li&gt;
&lt;li&gt;Creating a new file&lt;/li&gt;
&lt;li&gt;Reading from a File&lt;/li&gt;
&lt;li&gt;Writing to a File&lt;/li&gt;
&lt;li&gt;Closing the File&lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;FILE POINTER&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;FILE is a structure defined in stdio.h&lt;/li&gt;
&lt;li&gt;fp is called structure pointer&lt;/li&gt;
&lt;/ul&gt;FILE *fp;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;FILE OPENING&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
FILE *fp ;&lt;br /&gt;
fp = fopen ( “a.c”, “r” ) ;&lt;br /&gt;
Steps:&lt;br /&gt;
&lt;ol start="1"&gt;&lt;li&gt;Firstly it searches on the disk the file to be opened.&lt;/li&gt;
&lt;li&gt;Then it loads the file from the disk into a place in memory called buffer.&lt;/li&gt;
&lt;li&gt;It sets up a character pointer that points to the first character of the buffer&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;READING FROM A FILE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;ch = fgetc ( fp ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;fgetc( ) &lt;/strong&gt;reads the character from the current pointer position.&lt;/li&gt;
&lt;li&gt;advances the pointer position so that it now points to the next character,&lt;/li&gt;
&lt;li&gt;&amp;nbsp;and returns the character that is read, which we collected in the variable &lt;strong&gt;ch&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;EOF means end of file&lt;/li&gt;
&lt;li&gt;Special character with ascii value 26 signifies end of file.&lt;/li&gt;
&lt;li&gt;The EOF macro is defined in the file “stdio.h”.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;CLOSING THE FILE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
fclose ( fp ) ;&lt;br /&gt;
Three operation will be performed:&lt;br /&gt;
&lt;ol start="1"&gt;&lt;li&gt;The characters in the buffer would be written to the file on the disk.&lt;/li&gt;
&lt;li&gt;At the end of file a character with ASCII value 26 would get written.&lt;/li&gt;
&lt;li&gt;The buffer would be eliminated from memory.&lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Writing to a FILE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Open the file in the write mode.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;fp = fopen ( “a.txt”, “w” ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Copy the string into file using fputs&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;fputs ( s, fp ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
void main( )&lt;br /&gt;
{&lt;br /&gt;
FILE *fp ;&lt;br /&gt;
char s[80] ;&lt;br /&gt;
&lt;strong&gt;fp = fopen ( “a.txt”, “w” ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;if ( fp == NULL )&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;puts ( “Cannot open file” ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;exit( ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;printf ( “\nEnter a few lines of text:\n” ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;while ( strlen ( gets ( s ) ) &amp;gt; 0 )&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;fputs ( s, fp ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;fputs ( “\n”, fp ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;fclose ( fp ) ;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;fputs and fgets&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
fputs(s,fp);&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Writes string s to file&lt;/li&gt;
&lt;/ul&gt;fgets(s,100,fp);&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Reads &amp;nbsp;file content of length 100 in string&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &lt;blockquote&gt;#include “stdio.h”&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
void main( )&lt;br /&gt;
{&lt;br /&gt;
FILE *fp ;&lt;br /&gt;
char s[80] ;&lt;br /&gt;
fp = fopen ( “a.txt”, “r” ) ;&lt;br /&gt;
if ( fp == NULL )&lt;br /&gt;
{&lt;br /&gt;
puts ( “Cannot open file” ) ;&lt;br /&gt;
exit(1 ) ;&lt;br /&gt;
}&lt;br /&gt;
while ( fgets ( s, 79, fp ) != NULL )&lt;br /&gt;
printf ( “%s” , s ) ;&lt;br /&gt;
fclose ( fp ) ;&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;FILE PRACTICE&lt;/span&gt;&lt;/strong&gt;&lt;/blockquote&gt;&lt;ol start="1"&gt;&lt;li&gt;Count char,tab, spaces&lt;/li&gt;
&lt;li&gt;Copy a file into another file&lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Bubble Sort&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#define MAX 10&lt;br /&gt;
void swap(int *x,int *y)&lt;br /&gt;
{&lt;br /&gt;
int temp;&lt;br /&gt;
temp = *x;&lt;br /&gt;
*x = *y;&lt;br /&gt;
*y = temp;&lt;br /&gt;
}&lt;br /&gt;
void bsort(int list[], int n)&lt;br /&gt;
{&lt;br /&gt;
for(int i=0;i&amp;lt;(n-1);i++)&lt;br /&gt;
for(int j=0;j&amp;lt;(n-(i+1));j++)&lt;br /&gt;
if(list[j] &amp;gt; list[j+1])&lt;br /&gt;
swap(&amp;amp;list[j],&amp;amp;list[j+1]);&lt;br /&gt;
}&lt;br /&gt;
void readlist(int list[],int n)&lt;br /&gt;
{&lt;br /&gt;
printf(“Enter the elements\n”);&lt;br /&gt;
for(int i=0;i&amp;lt;n;i++)&lt;br /&gt;
scanf(“%d”,&amp;amp;list[i]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void printlist(int list[],int n)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(“The elements of the list are: \n”);&lt;br /&gt;
for(int i=0;i&amp;lt;n;i++)&lt;br /&gt;
printf(“%d\t”,list[i]);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;blockquote&gt;void main()&lt;br /&gt;
{&lt;br /&gt;
int list[MAX], n;&lt;br /&gt;
printf(“Enter the number of elements in the list max = 10\n”);&lt;br /&gt;
scanf(“%d”,&amp;amp;n);&lt;br /&gt;
readlist(list,n);&lt;br /&gt;
printf(“The list before sorting is:\n”);&lt;br /&gt;
printlist(list,n);&lt;br /&gt;
bsort(list,n);&lt;br /&gt;
printf(“The list after sorting is:\n”);&lt;br /&gt;
printlist(list,n);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-4564496930648020965?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/4564496930648020965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/file-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4564496930648020965?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4564496930648020965?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/file-in-c.html' title='File in C'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DEYFQ3Y7cCp7ImA9WhVSFk8.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-1863114762087530323</id><published>2012-03-13T01:08:00.002-07:00</published><updated>2012-03-13T01:08:32.808-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-13T01:08:32.808-07:00</app:edited><title>structure in c Programming</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title"&gt;    structure in c Programming           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T02:17"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Structure in C Programming&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt;Structures&lt;/em&gt; are used when you want to process data of multiple data types but you still want to refer to the data as a single entity&lt;/li&gt;
&lt;li&gt;Ex: you might want to process information on students in the categories of name and marks&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Fields of structure are called members of the structure.&lt;/li&gt;
&lt;li&gt;Structures have members in the form:&lt;/li&gt;
&lt;/ul&gt;structurename.membername.&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Defining structure&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;struct student \\ A&lt;br /&gt;
{&lt;br /&gt;
char name[30]; \\ B&lt;br /&gt;
float marks; \\ C&lt;br /&gt;
} ;&lt;br /&gt;
struct student \\ A&lt;br /&gt;
{&lt;br /&gt;
char name[30]; \\ B&lt;br /&gt;
float marks; \\ C&lt;br /&gt;
}&lt;br /&gt;
m={“mukesh”, 12.5} ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
struct student&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ A&lt;br /&gt;
{&lt;br /&gt;
char name[30];&amp;nbsp;&amp;nbsp; \\ B&lt;br /&gt;
float marks;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ C&lt;br /&gt;
} student1;&lt;br /&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Statement A defines the structure type student. It has two members: name and marks.&lt;/li&gt;
&lt;li&gt;Statement B defines the structure member name of the type character 30.&lt;/li&gt;
&lt;li&gt;Statement C defines the structure member marks of the type float.&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Example&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &lt;blockquote&gt;struct student&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ A&lt;br /&gt;
{&lt;br /&gt;
char name[30];&amp;nbsp;&amp;nbsp; \\ B&lt;br /&gt;
float marks;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ C&lt;br /&gt;
};&lt;br /&gt;
void main ( )&lt;br /&gt;
{&lt;br /&gt;
struct student student1; \\ D&lt;br /&gt;
char s1[30];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ E&lt;br /&gt;
float f;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ F&lt;br /&gt;
scanf (“%s”, s1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ G&lt;br /&gt;
scanf (” %f”, &amp;amp; f);&amp;nbsp; \\ H&lt;br /&gt;
student1.name = s1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ I&lt;br /&gt;
student1.marks = f;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ J&lt;br /&gt;
printf (” Name is %s \n”, student1.name);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ K&lt;br /&gt;
printf (” Marks are %f \n”, student1.marks);&amp;nbsp;&amp;nbsp; \\ L&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Structure Pointer&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can access members of the structure using a pointer.&lt;/li&gt;
&lt;li&gt;To access members of the structure, you have to first create a  structure so that the address of the structure is assigned to the  pointer.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &lt;blockquote&gt;struct student&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ A&lt;br /&gt;
{&lt;br /&gt;
char name[30];&amp;nbsp;&amp;nbsp; \\ B&lt;br /&gt;
float marks;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ C&lt;br /&gt;
};&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ D&lt;br /&gt;
main ( )&lt;br /&gt;
{&lt;br /&gt;
struct student *student1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ E&lt;br /&gt;
struct student student2; \\ F&lt;br /&gt;
char s1[30];&lt;br /&gt;
float f;&lt;br /&gt;
student1 = &amp;amp;student2;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ G&lt;br /&gt;
scanf (“%s”, s1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;\\ H&lt;br /&gt;
scanf (” %f”, &amp;amp; f);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ I&lt;br /&gt;
*student1.name = s1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ J student1-&amp;gt; name = s1;&lt;br /&gt;
*student2.marks = f;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ K student1-&amp;gt; marks = f;&lt;br /&gt;
printf (” Name is %s \n”, *student1.name);&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ L&lt;br /&gt;
printf (” Marks are %f \n”, *student2.marks); \\ M&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Structure how to program&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;struct student&lt;br /&gt;
{&lt;br /&gt;
name char[30];&lt;br /&gt;
marks float;&lt;br /&gt;
};&lt;br /&gt;
main ( )&lt;br /&gt;
{&lt;br /&gt;
struct student student1;&lt;br /&gt;
student1 = read_student ( )&lt;br /&gt;
print_student( student1);&lt;br /&gt;
read_student_p(student1);&lt;br /&gt;
print_student (student1);&lt;br /&gt;
}&lt;br /&gt;
struct student read_student( )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ A&lt;br /&gt;
{&lt;br /&gt;
struct student student2;&lt;br /&gt;
gets(student2.name);&lt;br /&gt;
scanf(“%d”,&amp;amp;student2.marks);&lt;br /&gt;
return (student2);&lt;br /&gt;
}&lt;br /&gt;
void print_student (struct student student2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ B&lt;br /&gt;
{&lt;br /&gt;
printf( “name is %s\n”, student2.name);&lt;br /&gt;
printf( “marks are%d\n”, student2.marks);&lt;br /&gt;
}&lt;br /&gt;
void read_student_p(struct student student2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ C&lt;br /&gt;
{&lt;br /&gt;
gets(student2.name);&lt;br /&gt;
scanf(“%d”,&amp;amp;student2.marks);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Nested structure&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;Struct address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ A&lt;br /&gt;
{&lt;br /&gt;
plot char [30];&lt;br /&gt;
street char[30];&lt;br /&gt;
city char[30];&lt;br /&gt;
};&lt;br /&gt;
struct student&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ B&lt;br /&gt;
{&lt;br /&gt;
name char[30];&lt;br /&gt;
marks float;&lt;br /&gt;
struct address adr;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ C&lt;br /&gt;
};&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Structure:call by reference&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;Void main()&lt;br /&gt;
{&lt;br /&gt;
struct s var = { ‘C’, 100, 12.55 };&lt;br /&gt;
g ( &amp;amp;var ) ;&lt;br /&gt;
}&lt;br /&gt;
void g ( struct s *v )&lt;br /&gt;
{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v-&amp;gt;i=20;&lt;br /&gt;
printf ( “\n%c %d %f”, v -&amp;gt; ch, v-&amp;gt;i, v-&amp;gt;a ) ;&lt;/blockquote&gt;&lt;/div&gt;&lt;blockquote&gt;}&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-1863114762087530323?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/1863114762087530323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/structure-in-c-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/1863114762087530323?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/1863114762087530323?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/structure-in-c-programming.html' title='structure in c Programming'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DEcARncyfCp7ImA9WhVSFk8.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-7781123428688391194</id><published>2012-03-13T01:07:00.000-07:00</published><updated>2012-03-13T01:07:27.994-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-13T01:07:27.994-07:00</app:edited><title>DYNAMIC MEMORY ALLOCATION</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title"&gt;    DYNAMIC MEMORY ALLOCATION           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T02:15"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;DYNAMIC MEMORY ALLOCATION&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can use an array when you want to process data of the same data type and you know the size of data.&lt;/li&gt;
&lt;li&gt;Sometimes you may want to process the data but you don’t know what the size of the data is.&lt;/li&gt;
&lt;/ul&gt;EX. reading from a file or keyboard and you want to process the values&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;C has the facility of dynamic memory allocations.&lt;/li&gt;
&lt;li&gt;Using this, you can allocate the memory for your storage.&lt;/li&gt;
&lt;li&gt;The allocation is done at runtime.&lt;/li&gt;
&lt;/ul&gt;When your work is over, you can deallocate the memory.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The allocation of memory is done using three functions:&lt;/li&gt;
&lt;/ul&gt;&lt;ol start="1"&gt;&lt;li&gt;malloc,&lt;/li&gt;
&lt;li&gt;relloc and&lt;/li&gt;
&lt;li&gt;calloc.&lt;/li&gt;
&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;The functions return the pointers to void, so it can be typecast to any data type.&lt;/li&gt;
&lt;/ul&gt;These functions take the input as the size of memory requirement&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;malloc&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
malloc(n * sizeof(int));&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The prototype of the function is available in&amp;nbsp; malloc.h.&lt;/li&gt;
&lt;li&gt;You can allocate memory at runtime by using the function malloc.&lt;/li&gt;
&lt;li&gt;malloc allocates memory specified using an argument in terms of bytes.&lt;/li&gt;
&lt;li&gt;returns the pointer to storage from where the memory is allocated.&lt;/li&gt;
&lt;li&gt;You can deallocate the memory by using the function free.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;main()&lt;br /&gt;
{&lt;br /&gt;
int *base;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ A&lt;br /&gt;
int n=0;&lt;br /&gt;
printf(“how many integers you have to store \n”);&lt;br /&gt;
scanf(“%d”,&amp;amp;n);&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ B&lt;br /&gt;
base = (int *)malloc(n* sizeof(int));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ C&lt;br /&gt;
printf(“the base of allocation is %u \n”,base);&amp;nbsp;&amp;nbsp; \\ D&lt;br /&gt;
if(!base)&amp;nbsp; \\ E&lt;br /&gt;
printf(“unable to allocate size \n”);&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
for(int j=0;j&amp;lt;n;j++)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ F&lt;br /&gt;
*(base+j)=5;&lt;br /&gt;
}&lt;br /&gt;
free(base);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //G&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;calloc&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
calloc(10,2);&lt;br /&gt;
calloc takes two arguments: total number of data and the size of each data&lt;br /&gt;
&lt;br /&gt;
base = (int *)calloc(10,2);&lt;br /&gt;
printf(“the base of allocation %u \n”,base);&lt;br /&gt;
Memory bytes allocated&lt;br /&gt;
=total num*size of data type&lt;br /&gt;
=10*2&lt;br /&gt;
=20 bytes&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Free&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
free(base);&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Pointer as a parameter&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Example&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;malloc.h&amp;gt;&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
int *base;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ A&lt;br /&gt;
int i;&lt;br /&gt;
int cnt=0;&lt;br /&gt;
int sum=0;&lt;br /&gt;
printf(“how many integers you have to store \n”);&lt;br /&gt;
scanf(“%d”,&amp;amp;cnt);&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ B&lt;br /&gt;
base = (int *)malloc(cnt * sizeof(int));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ C&lt;br /&gt;
printf(“the base of allocation is %16lu \n”,base);&amp;nbsp;&amp;nbsp; \\ D&lt;br /&gt;
if(!base)&amp;nbsp; \\ E&lt;br /&gt;
printf(“unable to allocate size \n”);&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
for(int j=0;j&amp;lt;cnt;j++)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ F&lt;br /&gt;
*(base+j)=5;&lt;br /&gt;
}&lt;br /&gt;
sum = 0;&lt;br /&gt;
for(int j=0;j&amp;lt;cnt;j++)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ G&lt;br /&gt;
sum = sum + *(base+j);&lt;br /&gt;
printf(“total sum is %d\n”,sum);&lt;br /&gt;
free(base);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ H&lt;br /&gt;
printf(“the base of allocation is %16lu \n”,base);&lt;br /&gt;
base = (int *)malloc(cnt * sizeof(int));&lt;br /&gt;
printf(“the base of allocation is %16lu \n”,base);&lt;br /&gt;
base = (int *)malloc(cnt * sizeof(int));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ I&lt;br /&gt;
printf(“the base of allocation is %16lu \n”,base);&lt;br /&gt;
base = (int *)calloc(10,2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\ J&lt;br /&gt;
printf(“the base of allocation is %16lu \n”,base);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-7781123428688391194?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/7781123428688391194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/dynamic-memory-allocation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/7781123428688391194?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/7781123428688391194?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/dynamic-memory-allocation.html' title='DYNAMIC MEMORY ALLOCATION'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;Ak4EQ3c_eip7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-5240005763268704430</id><published>2012-03-12T23:08:00.002-07:00</published><updated>2012-03-12T23:08:22.942-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T23:08:22.942-07:00</app:edited><title>String in C</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title"&gt;    String in C           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T02:11"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;String in &amp;nbsp;C Programming&amp;nbsp;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ol start="1"&gt;&lt;li&gt;&amp;nbsp;char array&lt;/li&gt;
&lt;li&gt;declaration&lt;/li&gt;
&lt;li&gt;strcpy&lt;/li&gt;
&lt;li&gt;strcmp&lt;/li&gt;
&lt;li&gt;strcat&lt;/li&gt;
&lt;li&gt;strlen&lt;/li&gt;
&lt;li&gt;user defined functions&lt;/li&gt;
&lt;li&gt;gets and puts&lt;/li&gt;
&lt;li&gt;pointer array of strings&lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String first program&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
char string[] = “Hello, world!”;&lt;br /&gt;
printf(“%s\n”, string);&lt;br /&gt;
size is 14 including \0 escape sequence:string termination null char&lt;br /&gt;
%s format specifier&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; char string[] = “Hello, world!”;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //array of chars&lt;br /&gt;
char * string = “Hello, world!”;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //string&lt;br /&gt;
char * string[] ={“sanjiv”,”rajiv”};&amp;nbsp;&amp;nbsp; //aray of strings&lt;br /&gt;
printf(“%s”,string);&lt;br /&gt;
printf(“%s”,string);&lt;br /&gt;
printf(“%s %s”,string[0],string[1]);&lt;br /&gt;
&lt;br /&gt;
string[0] = ‘A’;&amp;nbsp; //right&lt;br /&gt;
string[0] = “A”;&amp;nbsp;&amp;nbsp; //wrong&lt;br /&gt;
printf(“\n”);&amp;nbsp; //right&lt;br /&gt;
printf(‘\n’); //wrong&lt;br /&gt;
&lt;/div&gt;A ascii value is65&lt;br /&gt;
‘a’………….97&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String copy&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
copy in first argument&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
char string1[] = “Hello, world!”;&lt;br /&gt;
char string2[20];&lt;br /&gt;
strcpy(string2, string1);&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String compare&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
if(strcmp(string3, string4)==0) is right&lt;br /&gt;
if(strcmp(string3, string4)) is wrong it behave like strdiff&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String concatenation&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
strcat(string5, string6);&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String lenth&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
char string7[] = “abc”;&lt;br /&gt;
int len = strlen(string7);&lt;br /&gt;
printf(“%d\n”, len);&lt;br /&gt;
not included \0&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String copy:user deifined&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;fes_strcpy(char dest[], char src[])&lt;br /&gt;
{&lt;br /&gt;
int i = 0;&lt;br /&gt;
while(src[i] != ‘\0′)&lt;br /&gt;
{&lt;br /&gt;
dest[i] = src[i];&lt;br /&gt;
i++;&lt;br /&gt;
}&lt;br /&gt;
dest[i] = ‘\0′;&lt;br /&gt;
}&lt;br /&gt;
//for loop&lt;br /&gt;
for(i = 0; src[i] != ‘\0′; i++)&lt;br /&gt;
dest[i] = src[i];&lt;br /&gt;
dest[i] = ‘\0′;&lt;br /&gt;
//&lt;br /&gt;
for(i = 0; ; i++)&lt;br /&gt;
{&lt;br /&gt;
dest[i] = src[i];&lt;br /&gt;
if(src[i] == ‘\0′)&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
//another way&lt;br /&gt;
while(dest[i] = src[i]) != ‘\0′){i++;}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String compare:user deifined&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;fes_strcmp(char str1[], char str2[])&lt;br /&gt;
{&lt;br /&gt;
int i = 0;&lt;br /&gt;
while(1)&lt;br /&gt;
{&lt;br /&gt;
if(str1[i] != str2[i])&lt;br /&gt;
return str1[i] – str2[i];&lt;br /&gt;
if(str1[i] == ‘\0′ &amp;amp;&amp;amp; str2[i] == ‘\0′)&lt;br /&gt;
return 0;&lt;br /&gt;
i++;&lt;br /&gt;
}&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String lenth:user deifined&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;int fes_strlen(char str[])&lt;br /&gt;
{&lt;br /&gt;
int i;&lt;br /&gt;
for(i = 0; str[i] != ‘\0′; i++);&lt;br /&gt;
return i;&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Sub String&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;char string1[] = “I am a programmer”;&lt;br /&gt;
char string2[6];&lt;br /&gt;
fes_substr(string2, string1, 5, 4);&lt;br /&gt;
printf(“%s\n”, string2);&lt;br /&gt;
//starts from 5th char and copy 4 chars.&lt;br /&gt;
fes_substr(char dest[], char src[], int offset, int len)&lt;br /&gt;
{&lt;br /&gt;
int i;&lt;br /&gt;
for(i = 0; i &amp;lt; len &amp;amp;&amp;amp; src[offset + i] != ‘\0′; i++)&lt;br /&gt;
dest[i] = src[i + offset];&lt;br /&gt;
dest[i] = ‘\0′;&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;String: gets and puts&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;gets,puts:&amp;nbsp; one string at a time&lt;/li&gt;
&lt;li&gt;takes string as a parameter.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &lt;blockquote&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
void main( )&lt;br /&gt;
{&lt;br /&gt;
char name[30] ;&lt;br /&gt;
printf ( “Enter your name\n” ) ;&lt;br /&gt;
gets ( name ) ;&lt;br /&gt;
puts ( “Welcome “);&lt;br /&gt;
puts ( name ) ;&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-5240005763268704430?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/5240005763268704430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/string-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/5240005763268704430?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/5240005763268704430?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/string-in-c.html' title='String in C'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;Ak8HSHc9fSp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-4612808686407970998</id><published>2012-03-12T23:07:00.002-07:00</published><updated>2012-03-12T23:07:19.965-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T23:07:19.965-07:00</app:edited><title>Functions in C</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title"&gt;    Functions in C           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T02:07"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Functions in C Programming&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Function Introduction:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function def?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Self contained block of statements that perform a coherent task of some kind.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function Advantage&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;modularity to the software&lt;/li&gt;
&lt;li&gt;readability to the software&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
ü&amp;nbsp; By using functions, you can divide complex tasks into small manageable tasks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function’s general terms&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Function protype declaration&lt;/li&gt;
&lt;li&gt;Function definition&lt;/li&gt;
&lt;li&gt;Function call&lt;/li&gt;
&lt;li&gt;Return type&lt;/li&gt;
&lt;li&gt;Calling function&lt;/li&gt;
&lt;li&gt;Called function&lt;/li&gt;
&lt;li&gt;Actual argument&lt;/li&gt;
&lt;li&gt;Formal argument&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function Important points&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Main function is always present&lt;/li&gt;
&lt;li&gt;Any function can be called from any other function&lt;/li&gt;
&lt;li&gt;main can also be called from any other function&lt;/li&gt;
&lt;li&gt;Information can be passed from one function to another using parameters.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function types:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Two types of funct&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;1.library functions&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
printf(), scanf(), getch(), putch()…&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;2.User Defined function&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Ex. Add(), sam()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function return&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
return (x)&amp;nbsp;&amp;nbsp; //returns value of variable x&lt;br /&gt;
&lt;br /&gt;
return(10)&amp;nbsp;&amp;nbsp; //return the value 10&lt;br /&gt;
&lt;br /&gt;
return;&amp;nbsp;&amp;nbsp; //returns garbage value&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Function can return only one value at a time&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Return(x, y); //wrong&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function scope&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The scope of a variable is local to the function in which&amp;nbsp; it is defined.&lt;/li&gt;
&lt;li&gt;See the example discussed in class&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function Example&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;&lt;em&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;void silchar();&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;void delhi();&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;void jaipur(); //function prototype declaration&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;void main()&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;silchar(); //call the function silchar&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;printf(“end of program”);&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;void silchar() //function definition&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;delhi();&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;printf(“I am in silchar\n”);&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;void delhi()&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;jaipur();&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;printf(“i am in delhi\n”);&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;void jaipur()&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;printf(“i am in jaipur\n”);&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;}&lt;/em&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Function&amp;nbsp; without protype&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int add (int x, int y)&lt;br /&gt;
{&lt;br /&gt;
int z;&lt;br /&gt;
z = x + y;&lt;br /&gt;
return (z);&lt;br /&gt;
}&lt;br /&gt;
void main ()&lt;br /&gt;
{&lt;br /&gt;
int i, j, k;&lt;br /&gt;
i = 10;&lt;br /&gt;
j = 20;&lt;br /&gt;
k = add(i, j);&lt;br /&gt;
printf (“The value of k is%d\n”, k);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;What happens when a function is called&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;void main()&lt;br /&gt;
{&lt;br /&gt;
int a=1,b=2,c=3,d=4, e;&lt;br /&gt;
e=funct(a,b,c,d); //a call to funct&lt;br /&gt;
}&lt;br /&gt;
int funct(int i, float j, int k, int l)&lt;br /&gt;
{&lt;br /&gt;
int z=i+j+k+l;&lt;br /&gt;
return (z);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;On Function call&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
ü&amp;nbsp; Formal arguments and local arguments are pushed into stack.&lt;br /&gt;
&lt;br /&gt;
Formal arguments: I,j,k,l&lt;br /&gt;
&lt;br /&gt;
Local arguments: z&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;On return(when the control returns from the funct)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
ü&amp;nbsp; Stack is cleared by calling function or called function.&lt;br /&gt;
&lt;br /&gt;
This decision depends upon calling convention&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Calling convention&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;C’s calling convention is from right to left order&lt;/li&gt;
&lt;li&gt;Arguments are passed from right to left order&lt;/li&gt;
&lt;li&gt;Stack is cleared by called function&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;Q. What is the output of the program:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; int i=1;&lt;br /&gt;
printf(“%d%d%d”,I,++I,i++);&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
output: 331&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; int i=1, j=2;&lt;br /&gt;
printf(“%d%d%d”,I,j);&lt;br /&gt;
Printf(“%d”,I,j);&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
output:&lt;br /&gt;
&lt;br /&gt;
1 2 garbage value&lt;br /&gt;
&lt;br /&gt;
1 garbage value(may be)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Calling a function&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Call by value:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
ü&amp;nbsp; Values of the variables are passed to the function&lt;br /&gt;
&lt;br /&gt;
ü&amp;nbsp; Examples discussed so far.&lt;br /&gt;
&lt;br /&gt;
ü&amp;nbsp; EX.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(x,y);&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Call by reference:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
ü&amp;nbsp; Address of the variable is passed to the function&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Call by value:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
void swap(int x, int y);&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int a=1; b=2;&lt;br /&gt;
swap(a,b);&lt;br /&gt;
printf(“a is %d\n b is%d\n”,a,b);&lt;br /&gt;
}&lt;br /&gt;
void swap(int x, int y)&lt;br /&gt;
{&lt;br /&gt;
int t;&lt;br /&gt;
t=x;&lt;br /&gt;
x=y;&lt;br /&gt;
y=t;&lt;br /&gt;
Printf(“x is %d\n Y is %d\n”,x,y);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Output:&lt;br /&gt;
&lt;br /&gt;
x is 2&lt;br /&gt;
&lt;br /&gt;
y is 1&lt;br /&gt;
&lt;br /&gt;
a is 1&lt;br /&gt;
&lt;br /&gt;
b is 2&lt;br /&gt;
&lt;br /&gt;
&lt;span style="text-decoration: underline;"&gt;Observations:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
ü&amp;nbsp; In call by value actual argument can’t be altered by changing the value of formal argument.&lt;br /&gt;
&lt;br /&gt;
Call by reference:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
void swap(int *x, int *y);&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int a=1; b=2;&lt;br /&gt;
swap(&amp;amp;a, &amp;amp;b);&lt;br /&gt;
printf(“a is %d\n b is%d\n”,a,b);&lt;br /&gt;
}&lt;br /&gt;
void swap(int *x, int *y)&lt;br /&gt;
{&lt;br /&gt;
int t;&lt;br /&gt;
t=*x;&lt;br /&gt;
X*=*y;&lt;br /&gt;
*y=t;&lt;br /&gt;
Printf(“x is %d\n Y is %d\n”,x,y);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;
&lt;/blockquote&gt;x is 2&lt;br /&gt;
y is 1&lt;br /&gt;
&lt;br /&gt;
a is 2&lt;br /&gt;
&lt;br /&gt;
b is 1&lt;br /&gt;
&lt;br /&gt;
Why?&lt;br /&gt;
&lt;br /&gt;
Ans: value is changed at the address of variable.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="text-decoration: underline;"&gt;Observations:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
ü&amp;nbsp; Using call by reference actual argument can be altered by changing the value of formal argument.&lt;br /&gt;
&lt;br /&gt;
ü&amp;nbsp; Using call by reference function can return more than one value at a time.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; EX. Calculate the area and perimeter of a circle by using call by reference and call by value(mixed call).&lt;br /&gt;
Given&amp;nbsp; Data:&amp;nbsp; radius of circle= 2 km.&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Recursive function&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A statement within the body of the&amp;nbsp; function calls the same function.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Ex:Factorial&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Factorial without recursion:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;int fact=1;&lt;br /&gt;
for(int i=n;i &amp;gt; 0; i–)&lt;br /&gt;
{&lt;br /&gt;
fact=fact*i;&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;strong&gt;Factorial with recursion:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;int rec(int n)&lt;br /&gt;
{&lt;br /&gt;
int f;&lt;br /&gt;
if(n==1)&lt;br /&gt;
return (1);&lt;br /&gt;
else&lt;br /&gt;
f=n*rec(n-1);&lt;br /&gt;
&lt;br /&gt;
return (f);&lt;br /&gt;
}&lt;br /&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-4612808686407970998?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/4612808686407970998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/functions-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4612808686407970998?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4612808686407970998?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/functions-in-c.html' title='Functions in C'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;AkAMSH0_fip7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-280512981031543483</id><published>2012-03-12T23:06:00.000-07:00</published><updated>2012-03-12T23:06:29.346-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T23:06:29.346-07:00</app:edited><title>ARRAY</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;i&gt;&lt;b&gt;Array&amp;nbsp; Array Introduction:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Array def?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Array define&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Array accessing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Different types of array&lt;/li&gt;
&lt;/ul&gt;&lt;h1 class="post-title entry-title"&gt;    Array Basics           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T01:58"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;ARRAY In C Programming:&lt;/strong&gt;&lt;br /&gt;
Array Introduction:&lt;br /&gt;
&lt;ol start="1"&gt;&lt;li&gt;&amp;nbsp;Array def?&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Array define&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Array accessing&lt;/li&gt;
&lt;li&gt;&amp;nbsp;different types of array&lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;br /&gt;
ü&amp;nbsp; Collection of similar data type.&lt;br /&gt;
ü&amp;nbsp; One name for a group of variables of the same type.&lt;br /&gt;
ü&amp;nbsp; Contiguous memory allocation&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;An array is a composite data structure in which you can store multiple values. Array elements are accessed using subscript.&lt;/li&gt;
&lt;li&gt;The subscript operator has the highest precedence. Thus if you write a[2]++,it increments the value at location 2 in the array.&lt;/li&gt;
&lt;li&gt;The valid range of subscript is 0 to size −1.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;ARRAY DEFINE&lt;/strong&gt;&lt;br /&gt;
Elements of Array:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The information stored in array.&lt;/li&gt;
&lt;/ul&gt;syntax for declaring an array:&lt;br /&gt;
ü&amp;nbsp; int marks[100];&lt;br /&gt;
ü&amp;nbsp; char name[10];&lt;br /&gt;
int marks[100];&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Integer array with 100 slots in which the values of an array are stored.&lt;/li&gt;
&lt;/ul&gt;Int a[7]={3,5,6,1,6,3,2};&lt;br /&gt;
Int a[]={3,5,6,1,6,3,2};&lt;br /&gt;
float a[]={3.3,5.4,6.23,1.23,6.32,3.2,2};&lt;br /&gt;
&lt;strong&gt;ACCESSING ARRAY ELEMENT:&lt;/strong&gt;&lt;br /&gt;
int marks[100];&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
Accessing:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;marks[0] will return the first element.&lt;/li&gt;
&lt;li&gt;marks[5] will return the sixth element.&lt;/li&gt;
&lt;li&gt;marks[99] will return the last element.&lt;/li&gt;
&lt;li&gt;marks[100] compile time error.&lt;/li&gt;
&lt;/ul&gt;NOTE: Use %u for addresss as address is unsigned&lt;br /&gt;
Array of character&lt;br /&gt;
char name[10];&lt;br /&gt;
-String:Array of characters&lt;br /&gt;
input:&lt;br /&gt;
scanf( “%s”, name);&lt;br /&gt;
ü&amp;nbsp; %s for string&lt;br /&gt;
ü&amp;nbsp; we don’t use the ampersand! It turns out that when we pass arrays  into functions, the compiler automatically converts the array into a  pointer to the first element of the array. In short, the array without  any brackets will act like a pointer. So we just pass the array directly  into scanf without using the ampersand and it works perfectly.&lt;br /&gt;
&lt;div&gt; &lt;strong&gt;&amp;nbsp;#include &amp;lt;stdio.h&amp;gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;main()&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp; int a[5]={2,6,12,21,42};&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp; for(int i = 0;i&amp;lt;5;i++)&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(“value in array %d\n”,a[i]);&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
int a[5];&lt;br /&gt;
for(int i = 0;i&amp;lt;5;i++)&lt;br /&gt;
{&lt;br /&gt;
a[i]=i;&lt;br /&gt;
}&lt;br /&gt;
for(int i = 0;i&amp;lt;5;i++)&lt;br /&gt;
{&lt;br /&gt;
printf(“value in array %d\n”,a[i]);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;Checking Special Character&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; char name[10];&lt;br /&gt;
int i = 0;&lt;br /&gt;
/* Using scanf isn’t really the best way to do this; we’ll talk about that in the next class, on strings */&lt;br /&gt;
scanf( “%s”, name );&lt;br /&gt;
for ( i = 0; i &amp;lt; 10; ++i )&lt;br /&gt;
{&lt;br /&gt;
if ( name[i] == ‘a’ )&lt;br /&gt;
{&lt;br /&gt;
printf( “You entered an a!\n” );&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;Array Basic Practice:&lt;/strong&gt;&lt;br /&gt;
Q.1 For all array element of int type:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Sum?&lt;/li&gt;
&lt;li&gt;Average?&lt;/li&gt;
&lt;/ul&gt;Q.2&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Print address of all elements of array[%u]&lt;/li&gt;
&lt;/ul&gt;Q.3 Increment the address of array and print next value&lt;br /&gt;
Hint:&amp;nbsp; K=arr+2;&lt;br /&gt;
Print *k&lt;br /&gt;
Q3.&lt;br /&gt;
Part1:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Store marks in array.&lt;/li&gt;
&lt;li&gt;Show the total passed students on screen.&lt;/li&gt;
&lt;/ul&gt;Part2:&lt;br /&gt;
Each student is assigned a id to access his/her marks.&lt;br /&gt;
Let the user input his id and show him the marks&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Show him result [grade also]&lt;/li&gt;
&lt;/ul&gt;&lt;h1 class="post-title entry-title"&gt;    Array 2           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T02:00"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Pointer array:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&amp;nbsp; Def: Collection of addresses&lt;br /&gt;
int *a[2];&lt;br /&gt;
int i1=5, i2=4;&lt;br /&gt;
a[0]=&amp;amp;i1;&lt;br /&gt;
a[1]=&amp;amp;i2;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can store pointers in arrays.&lt;/li&gt;
&lt;li&gt;You can access values specified by these values by using the * notations.&lt;/li&gt;
&lt;li&gt;In pointer array, the array elements are the pointer that points to integer values.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;for( j=0;j&amp;lt;5;j++)&lt;br /&gt;
{&lt;br /&gt;
printf(“value %d add: %u %u \n “, **a, *a, a);&lt;br /&gt;
a++;&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;//value of variables i1,i2&lt;br /&gt;
//address of elements&lt;br /&gt;
//address of a&lt;br /&gt;
// a[j] address of variables i1,i2&lt;br /&gt;
//*a[j] value of variables i1,i2&lt;br /&gt;
//&amp;amp;a[j]) address of a&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Two Dimensional array&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can define a multi-dimensional array in C.&lt;/li&gt;
&lt;li&gt;You have to provide multiple subscripts for accessing array elements.&lt;/li&gt;
&lt;li&gt;Array of array: 2D array&lt;/li&gt;
&lt;/ul&gt;It is taken as an array of an array. Logically, the two-dimensional array 3 X 2 is taken as&lt;br /&gt;
1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;br /&gt;
5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;br /&gt;
7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&amp;nbsp; Here there are three arrays, i.e. one array in each row.&lt;/li&gt;
&lt;li&gt;&amp;nbsp; The values are stored as 1 2 5 6 7 8&lt;/li&gt;
&lt;li&gt;&amp;nbsp; This style is called &lt;em&gt;row measure form&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &lt;blockquote&gt;int a[3][2];&lt;br /&gt;
for(int i = 0;i&amp;lt;3;i++)&lt;br /&gt;
{&lt;br /&gt;
for(int j=0;j&amp;lt;2 ;j++)&lt;br /&gt;
{&lt;br /&gt;
a[i][j]=i;&lt;br /&gt;
}&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;2-Dimensional array Accessing&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;for(int i = 0;i&amp;lt;3;i++)&lt;br /&gt;
{&lt;br /&gt;
for(int j=0;j&amp;lt;2;j++)&lt;br /&gt;
{&lt;br /&gt;
printf(“value in array %d\n”,a[i][j]);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;2-Dimensional array Accessing using pointers&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;&amp;nbsp;int *b;&lt;br /&gt;
b=a;&lt;br /&gt;
for(int i = 0; i&amp;lt;6;i++)&lt;br /&gt;
{&lt;br /&gt;
printf(“%d address is&amp;nbsp; %16lu\n”,*b,b);&lt;br /&gt;
b++; // increase by 2 bytes for 16bit compiler&lt;br /&gt;
}&lt;/blockquote&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;You can access array elements by using a pointer&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Three Dimensional array&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;format: a[i][j][k]&lt;/li&gt;
&lt;li&gt;Array of array of array&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &lt;blockquote&gt;&amp;nbsp;&amp;nbsp; for(int i=0;i&amp;lt;2;i++)&lt;br /&gt;
for(int j=0;j&amp;lt;3;j++)&lt;br /&gt;
for(int k=0;k&amp;lt;4;k++)&lt;br /&gt;
{&lt;br /&gt;
//a[i][j][k]&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt; &lt;blockquote&gt;Int a[2][3][4]={&lt;br /&gt;
{&lt;br /&gt;
{2,3,4,5},&lt;br /&gt;
{1,2,4,5},&lt;br /&gt;
{2,3,1,2},&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
{6,3,6,8},&lt;br /&gt;
{7,5,4,6},&lt;br /&gt;
{3,2,1,5},&lt;br /&gt;
}&lt;br /&gt;
};&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&amp;nbsp;                     &lt;/div&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-280512981031543483?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/280512981031543483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/280512981031543483?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/280512981031543483?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/array.html' title='ARRAY'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;AkQER3w9fyp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-545843672638504979</id><published>2012-03-12T22:58:00.002-07:00</published><updated>2012-03-12T22:58:26.267-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T22:58:26.267-07:00</app:edited><title>C Basic Concepts</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title"&gt;    C Basic Concepts           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T01:50"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Constants:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Primary constant&lt;/li&gt;
&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;Int,real,char&lt;/li&gt;
&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;Secondary constant&lt;/li&gt;
&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;Array,pointer,structure,union,enum&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;INT CONSTANT:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;int range in 16 bit compiler[turbo c++]&lt;/li&gt;
&lt;li&gt;-32768 to 32768&lt;/li&gt;
&lt;li&gt;EX. 300,+400,-678&lt;/li&gt;
&lt;li&gt;Char: only single element&lt;/li&gt;
&lt;li&gt;‘a’&lt;/li&gt;
&lt;li&gt;‘=‘&lt;/li&gt;
&lt;li&gt;‘4’&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;REAL CONSTANT:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
EX.&lt;br /&gt;
+312.678&lt;br /&gt;
0.02412&lt;br /&gt;
-24.653&lt;br /&gt;
In exponential form:&lt;br /&gt;
(Mantissa)e(exponent)&lt;br /&gt;
2.412e-2&lt;br /&gt;
2.412E-2&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;VARIABLES/IDENTIFIER&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A variable is a seqeuence of program code with a name (also called its identifier).&lt;/li&gt;
&lt;li&gt;A name or identifier in C can be anything from a single letter to a word.&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp; NAMING CONVENTION&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The name of a variable must begin with an alphabetic letter or the  underscore _ character but the other characters in the name can be  chosen from the following groups:&lt;/li&gt;
&lt;li&gt;a .. Z (any letter from a to z)&lt;/li&gt;
&lt;li&gt;A .. Z (any letter from A to Z)&lt;/li&gt;
&lt;li&gt;0 .. 9&amp;nbsp;&amp;nbsp; (any digit from 0 to 9)&lt;/li&gt;
&lt;li&gt;_&amp;nbsp;&amp;nbsp;&amp;nbsp; (the underscore character)&lt;/li&gt;
&lt;li&gt;Some examples of valid variable names are:&lt;/li&gt;
&lt;/ul&gt;a , total , Out_of_Memory,&amp;nbsp; VAR , integer&amp;nbsp; etc…&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;-Variables do not only have names: they also have types[data type].&lt;/li&gt;
&lt;li&gt;- The type of a variable conveys to the the compiler what sort of data will be stored in it.[already discussed]&lt;/li&gt;
&lt;li&gt;Particular type of variable can accept same type of constant only.&lt;/li&gt;
&lt;/ul&gt;EX. Int variable will have int constants&lt;br /&gt;
float variable will have float(real) constant&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Reserved keyword&lt;/span&gt;&lt;/strong&gt;:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;C demands that they are used only for giving commands or making statements.&lt;/li&gt;
&lt;li&gt;You cannot use it as the name of a variable. An attempt to do so will result in a compilation error.&lt;/li&gt;
&lt;li&gt;In fact, most of the facilities which C offers are provided as  libraries that are included in programs as plug-in expansion units.  While the features provided by libraries are not strictly a part of the C  language itself, they are essential and you will never find a version  of C without them. After a library has been included in a program, its  functions are defined and you cannot use their names.&lt;/li&gt;
&lt;li&gt;C requires all of these reserved words to be in lower case. (This  does mean that, typed in upper case, the reserved words could be used as  variable names, but this is not recommended.)&lt;/li&gt;
&lt;li&gt;(A “d” by the word implies that it is used as part of a declaration.)&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; auto d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;br /&gt;
break&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int d&lt;br /&gt;
case&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; long d&lt;br /&gt;
char d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; register d&lt;br /&gt;
continue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;br /&gt;
default&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; short d&lt;br /&gt;
do&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sizeof&lt;br /&gt;
double d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static d&lt;br /&gt;
else&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; struct&lt;br /&gt;
entry&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; switch&lt;br /&gt;
extern d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; typedef d&lt;br /&gt;
float d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; union d&lt;br /&gt;
for&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned d&lt;br /&gt;
goto&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while&lt;br /&gt;
also in modern implementations:&lt;br /&gt;
enum d&lt;br /&gt;
void d&lt;br /&gt;
const d&lt;br /&gt;
signed d&lt;br /&gt;
volatile d&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Libraries:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Special functionality is provided in the form of libraries of ready-made functions.&lt;/li&gt;
&lt;li&gt;This is what makes C so portable.&lt;/li&gt;
&lt;li&gt;You can also make your own, but to do so you need to know how your operating system builds libraries.&lt;/li&gt;
&lt;li&gt;Libraries are files of ready-compiled code which we can merge with a C program at compilation time.&lt;/li&gt;
&lt;li&gt;Each library comes with a number of associated header files which make the functions easier to use.&lt;/li&gt;
&lt;li&gt;For example, there are libraries of mathematical functions, string  handling functions and input/output functions and graphics libraries.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;DATATYPES:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
Data type indicates:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;what information is stored in the variable,&lt;/li&gt;
&lt;li&gt;the amount of memory[number of bytes] that can be allocated for storing the data in the variable, and&lt;/li&gt;
&lt;li&gt;The available operations that can be performed on the variable.&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp; Integer family&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;char data type&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int data type&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;short int data type&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;long int data type&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp; Float family (real numbers with decimal points)&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Float data type&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Double data type&lt;/li&gt;
&lt;li&gt;Characters are stored internally as integers, and they are  interpreted according to the character set. The most commonly used  character set is ASCII. In the ASCII character set, A is represented by  the number 65.&lt;/li&gt;
&lt;li&gt;Each family has sub-data types that differ in the amount of storage space allocated to them.&lt;/li&gt;
&lt;li&gt;In general, the data types that are allocated more storage space can store larger values.&lt;/li&gt;
&lt;li&gt;Integer data types are used for storing whole numbers and characters. The integers are internally stored in binary form&lt;/li&gt;
&lt;/ul&gt;EX. Number =13&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Decimal representation = 1*10^1 + 3*10^0&lt;/li&gt;
&lt;li&gt;Binary representation = 1101 = 1*2^3 + 1*2^2 + 0*2^1 + 1*2^0&lt;/li&gt;
&lt;/ul&gt;Each 1 or 0 is called a bit, thus the number 13 requires 4 bits&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;FLOAT DATA TYPE:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;There are two types of representation: short or single- precision  floating-point number and long or double-precision floating-point  number. short occupies 4 bytes or 32 bits while long occupies 8 bytes or  64 bits.&lt;/li&gt;
&lt;li&gt;short&amp;nbsp;&amp;nbsp; 4 bytes&lt;/li&gt;
&lt;li&gt;long&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 bytes&lt;/li&gt;
&lt;li&gt;float&amp;nbsp; 4bytes&lt;/li&gt;
&lt;li&gt;double 8bytes&lt;/li&gt;
&lt;li&gt;Float occupies 4 bytes and double occupies 8 bytes&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;OVERFLOW EXAMPLE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&amp;nbsp;Overflow means you are carrying out an operation such that the  value either exceeds the maximum value or is less than the minimum value  of the data type.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; // the program gives maximum and minimum values of data type&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
char i,j ;&lt;br /&gt;
i = 1;&lt;br /&gt;
while (i &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
j = i;&lt;br /&gt;
i++;&lt;br /&gt;
}&lt;br /&gt;
printf (“the maximum value of char is %d\n”,j);&lt;br /&gt;
printf (“the value of char after overflow is %d\n”,i);&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;TYPE CASTING&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Type casting is used when you want to convert the value of one data type to another&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
double d1 = 123.56;&lt;br /&gt;
int i1=456;&lt;br /&gt;
printf(“the value of d1 as int without cast operator %d\n”,d1);&lt;br /&gt;
printf(“the value of d1 as int with cast operator %d\n”,(int)d1);&lt;br /&gt;
printf(“the value of i1 as double without cast operator %f\n”,i1);&lt;br /&gt;
printf(“the value of i1 as double with cast operator %f\n”,(double)i1);&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;Practice:try it&lt;br /&gt;
&lt;div&gt; #include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
char c;&lt;br /&gt;
c=66;&lt;br /&gt;
printf(“%c”,c);&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Operator:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Assignment operator&lt;/li&gt;
&lt;li&gt;Arithmatic&lt;/li&gt;
&lt;li&gt;Relational&lt;/li&gt;
&lt;li&gt;Logical&lt;/li&gt;
&lt;li&gt;Ternary&lt;/li&gt;
&lt;li&gt;Increment&lt;/li&gt;
&lt;li&gt;Bitwise operator&lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Assignment operators:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
=, +=, -=, *=, /=, %=.&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Arithmetic operators&lt;/span&gt;&lt;/strong&gt; :&lt;br /&gt;
+, -, *, \ and the modulus operator %.&lt;br /&gt;
ü&amp;nbsp; % indicates the remainder after integer division;&lt;br /&gt;
ü&amp;nbsp; % cannot be used for float data type or double data type.&lt;br /&gt;
ü&amp;nbsp; If both operands i1 and i2 are integers, the expression i1/i2  provides integer division, even if the target is a floating point  variable.&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;relational operators&lt;/span&gt;&lt;/strong&gt; are as follows:&lt;br /&gt;
&amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=, ==, !=&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;logical operators&lt;/span&gt;&lt;/strong&gt; [see fig2]are negation (!), logical AND (&amp;amp;&amp;amp;), and logical OR (||), in the same order of preference.&lt;br /&gt;
General form of the ternary operator is:&lt;br /&gt;
(expr 1) ? expr2 : expr3&lt;br /&gt;
ü&amp;nbsp; If expr1 returns true then the value of expr2 is returned as a result; otherwise the value of expr3 is returned.&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Increment opr:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
i++,++I,i–,–I&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Bitwise Operator:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;There are six bitwise operators:&lt;/li&gt;
&lt;/ul&gt;bitwise AND(&amp;amp;), bitwise OR(|)&lt;br /&gt;
bitwise XOR(^), bitwise complement(~)&lt;br /&gt;
left shift(&amp;lt;&amp;lt;), and right shift(&amp;gt;&amp;gt;)&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;multiplication by a number which is power of 2&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;&lt;/li&gt;
&lt;li&gt;division by a number which is power of 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt; &lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;# include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;main()&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;{&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; char c1,c2,c3;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; printf(“ENTER VAULES OF c1 and c2″);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; scanf(“%c,%c”,&amp;amp;c1,&amp;amp;c2);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; c3 = c1 &amp;amp; c2;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; printf(“\n Bitwise AND i.e. c1 &amp;amp; c2 = %c”,c3);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; c3 = c1 | c2;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; printf(“\n Bitwise OR i.e. c1 | c2 = %c”,c3);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; c3 = c1 ^ c2;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; printf(“\n Bitwise XOR i.e. c1 ^ c2 = %c”,c3);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; c3 = ~c1;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; printf(“\n ones complement of c1 = %c”,c3);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; c3 = c1&amp;lt;&amp;lt;2;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; printf(“\n left shift by 2 bits c1 &amp;lt;&amp;lt; 2 = %c”,c3);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; c3 = c1&amp;gt;&amp;gt;2;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; printf(“\n right shift by 2 bits c1 &amp;gt;&amp;gt; 2 = %c”,c3);&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;}&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Explanation&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
Suppose you write&lt;br /&gt;
char c1, c2, c3;&lt;br /&gt;
c1 = 4;&lt;br /&gt;
c2 = 6;&lt;br /&gt;
The binary values are&lt;br /&gt;
c1 = 0000 0100&lt;br /&gt;
c2 = 0000 0110&lt;br /&gt;
Suppose you write&lt;br /&gt;
c3 = c1 &amp;amp; c2;&lt;br /&gt;
The value of c3 is interpreted as follows:&lt;br /&gt;
0000 0100&lt;br /&gt;
&amp;amp; 0000 0110&lt;br /&gt;
———-.&lt;br /&gt;
0000 0100&lt;br /&gt;
Each bit of c1 is compared with the corresponding bit of c2. If both  bits are 1 then the corresponding bit is set as 1, otherwise it is set  as 0. Thus the value of c3 is 4.&lt;br /&gt;
c3 = c1 | c2&lt;br /&gt;
The value of c3 is interpreted as follows:&lt;br /&gt;
0000 0100&lt;br /&gt;
| 0000 0110&lt;br /&gt;
———–.&lt;br /&gt;
0000 0110&lt;br /&gt;
Each bit of c1 is compared with the corresponding bit of c2. If any  of the bits are 1 then the corresponding bit is set as 1; otherwise it  is set as 0. Thus the value of c3 is 6.&lt;br /&gt;
c3 = c1 ^ c2&lt;br /&gt;
The value of c3 is interpreted as follows:&lt;br /&gt;
0000 0100&lt;br /&gt;
^ 0000 0110&lt;br /&gt;
———-.&lt;br /&gt;
0000 0010&lt;br /&gt;
c3 = ~ c1&lt;br /&gt;
The value of c3 is interpreted as follows:&lt;br /&gt;
~&amp;nbsp; 0000 0100&lt;br /&gt;
———-.&lt;br /&gt;
1111 1011&lt;br /&gt;
Each bit of c1 is complemented; for 1 the complement is 0. Thus you  will get the value of c3 as -4, because the leftmost bit is set as 1.&lt;br /&gt;
c3 = c1 &amp;lt;&amp;lt; 2;&lt;br /&gt;
This is a left-shift operation. The bits are shifted left by two  places. c1 indicates the operand that should be an expression returning a  whole number. 2 indicates a shift that should not be negative, and its  value must be less than the number of bits allocated to that data type.&lt;br /&gt;
It is evaluated as follows:&lt;br /&gt;
c1 is 0000 0100&lt;br /&gt;
It is shifted 2 bits to the left to produce&lt;br /&gt;
0001 00**&lt;br /&gt;
While shifting, the high-order (left) bits are discarded. Since a  vacuum is created on the right side, it is filled with 0s to get 0001  0000. Thus the value is 16.&lt;br /&gt;
c3 = c1 &amp;gt;&amp;gt; 2;&lt;br /&gt;
This is a right shift operation. The bits are shifted right by two  places. c1 indicates the operand that should be an expression returning a  whole number. 2 indicates a shift that should not be negative, and its  value must be less than the number of bits allocated to that data type.&lt;br /&gt;
It is evaluated as follows:&lt;br /&gt;
c1 is 0000 0100&lt;br /&gt;
It is shifted 2 bits to the right to produce&lt;br /&gt;
**00 0001&lt;br /&gt;
Fig:1&lt;br /&gt;
&lt;br /&gt;
Fig2&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;ADDRESS:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Each variable has two attributes: address and value.&lt;/li&gt;
&lt;li&gt;The address is the location in memory where the value of the variable is stored.&lt;/li&gt;
&lt;li&gt;During the lifetime of the variable, the address is not changed but the value may change.&lt;/li&gt;
&lt;/ul&gt;For the integer type, 2 bytes are allocated, for floats, 4 bytes are allocated, etc.&lt;br /&gt;
data type =&amp;nbsp; char&amp;nbsp;&amp;nbsp; int&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;br /&gt;
Byte&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;br /&gt;
EXAMPLE:&lt;br /&gt;
&lt;div&gt; #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main ()&lt;br /&gt;
{&lt;br /&gt;
int x, y, z;&lt;br /&gt;
x = 10;&lt;br /&gt;
y= 20;&lt;br /&gt;
z= x + y;&lt;br /&gt;
printf (“Value of z is %d\n”, z);&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;EXPLANATION&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&amp;nbsp; Memory allocations to the variables can be explained using the following variables:&lt;br /&gt;
&lt;br /&gt;
100, x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;br /&gt;
200, y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;br /&gt;
300, z&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;When you declare variables x, y, z, memory is allocated for storing the values of the variables.&lt;/li&gt;
&lt;li&gt;For example, 2 bytes are allocated for x, at location 100, 2 bytes  are allocated for y at location 200, and 2 bytes allocated for z at  location 300.&lt;/li&gt;
&lt;li&gt;Here 100 is called the address of x, 200 is called address of y, and 300 is called the address of z.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;POINTERS:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A pointer to an integer is a variable that can store the address of that integer.&lt;/li&gt;
&lt;li&gt;A &lt;em&gt;pointer&lt;/em&gt; is a variable whose value is also an address.&lt;/li&gt;
&lt;li&gt;&amp;amp;i address of i&lt;/li&gt;
&lt;li&gt;*ai value at the address ai&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;You can define a pointer by including a * before the name of the variable.&lt;/li&gt;
&lt;/ul&gt;int *ia;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can get the address where a variable is stored by using &amp;amp;.&lt;/li&gt;
&lt;/ul&gt;&amp;amp;I&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Pointers give a facility to access the value of a variable indirectly.&lt;/li&gt;
&lt;/ul&gt;*ia&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt; #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main ()&lt;br /&gt;
{&lt;br /&gt;
int i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //A&lt;br /&gt;
int * ia;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //B&lt;br /&gt;
i = 10;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //C&lt;br /&gt;
ia = &amp;amp;i;&amp;nbsp;&amp;nbsp; //D&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div&gt; #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main ()&lt;br /&gt;
{&lt;br /&gt;
int i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //A&lt;br /&gt;
int * ia;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //B&lt;br /&gt;
i = 10;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //C&lt;br /&gt;
ia = &amp;amp;i;&amp;nbsp;&amp;nbsp; //D&lt;br /&gt;
printf (” The address of i is %8u \n”, ia);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //E&lt;br /&gt;
printf (” The value at that location is %d\n”, i);&amp;nbsp;&amp;nbsp; //F&lt;br /&gt;
printf (” The value at that location is %d\n”, *ia); //G&lt;br /&gt;
*ia = 50;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //H&lt;br /&gt;
printf (“The value of i is %d\n”, i);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //I&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;EXPLANATION:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The program declares two variables, so memory is allocated for two  variables. i is of the type of int, and ia can store the address of an  integer, so it is a pointer to an integer.&lt;/li&gt;
&lt;li&gt;The memory allocation is as follows&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;i gets the address 1000, and ia gets address 4000.&lt;/li&gt;
&lt;li&gt;When you execute i = 10, 10 is written at location 1000.&lt;/li&gt;
&lt;li&gt;When you execute ia = &amp;amp;i then the address and value are assigned to i, thus i has the address of 4000 and value is 1000.&lt;/li&gt;
&lt;li&gt;You can print the value of i by using the format %8u because  addresses are usually in the format unsigned long, as given in statement  E.&lt;/li&gt;
&lt;li&gt;you can print the value at location 1000 using statement G. *ia  means you are printing the value at the location specified by ia. Since i  has the value for 1000, it will print the value at location 1000.&lt;/li&gt;
&lt;li&gt;When you execute *ia = 50, which is specified by statement H, the  value 50 is written at the location by ia. Since ia specifies the  location 1000, the value at the location 1000 is written as 50.&lt;/li&gt;
&lt;li&gt;Since i also has the location 1000, the value of i gets changed  automatically from 10 to 50, which is confirmed from the printf  statement written at position i.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;ARRAY:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
Array Introduction:&lt;br /&gt;
&lt;ol start="1"&gt;&lt;li&gt;&amp;nbsp;Array def?&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Array define&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Array accessing&lt;/li&gt;
&lt;li&gt;&amp;nbsp;different types of array&lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Definition:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
ü&amp;nbsp; Collection of similar data type.&lt;br /&gt;
ü&amp;nbsp; One name for a group of variables of the same type.&lt;br /&gt;
ü&amp;nbsp; Contiguous memory allocation&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;An array is a composite data structure in which you can store multiple values. Array elements are accessed using subscript.&lt;/li&gt;
&lt;li&gt;The subscript operator has the highest precedence. Thus if you write a[2]++,it increments the value at location 2 in the array.&lt;/li&gt;
&lt;li&gt;The valid range of subscript is 0 to size −1.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;ARRAY DEFINE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
Elements of Array:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The information stored in array.&lt;/li&gt;
&lt;/ul&gt;syntax for declaring an array:&lt;br /&gt;
ü&amp;nbsp; int marks[100];&lt;br /&gt;
ü&amp;nbsp; char name[10];&lt;br /&gt;
int marks[100];&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Integer array with 100 slots in which the values of an array are stored.&lt;/li&gt;
&lt;/ul&gt;Int a[7]={3,5,6,1,6,3,2};&lt;br /&gt;
Int a[]={3,5,6,1,6,3,2};&lt;br /&gt;
float a[]={3.3,5.4,6.23,1.23,6.32,3.2,2};&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;ACCESSING ARRAY ELEMENT:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
int marks[100];&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
Accessing:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;marks[0] will return the first element.&lt;/li&gt;
&lt;li&gt;marks[5] will return the sixth element.&lt;/li&gt;
&lt;li&gt;marks[99] will return the last element.&lt;/li&gt;
&lt;li&gt;marks[100] compile time error.&lt;/li&gt;
&lt;/ul&gt;NOTE: Use %u for addresss as address is unsigned&lt;br /&gt;
&lt;span style="text-decoration: underline;"&gt;Array of character&lt;/span&gt;&lt;br /&gt;
char name[10];&lt;br /&gt;
-String:Array of characters&lt;br /&gt;
input:&lt;br /&gt;
scanf( “%s”, name);&lt;br /&gt;
ü&amp;nbsp; %s for string&lt;br /&gt;
ü&amp;nbsp; we don’t use the ampersand! It turns out that when we pass arrays  into functions, the compiler automatically converts the array into a  pointer to the first element of the array. In short, the array without  any brackets will act like a pointer. So we just pass the array directly  into scanf without using the ampersand and it works perfectly.&lt;br /&gt;
&lt;div&gt; &lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;main() &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp; int a[5]={2,6,12,21,42};&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp; for(int i = 0;i&amp;lt;5;i++)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(“value in array %d\n”,a[i]);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;} &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div&gt; #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
int a[5];&lt;br /&gt;
for(int i = 0;i&amp;lt;5;i++)&lt;br /&gt;
{&lt;br /&gt;
a[i]=i;&lt;br /&gt;
}&lt;br /&gt;
for(int i = 0;i&amp;lt;5;i++)&lt;br /&gt;
{&lt;br /&gt;
printf(“value in array %d\n”,a[i]);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Checking Special Character&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt; char name[10];&lt;br /&gt;
int i = 0;&lt;br /&gt;
/* Using scanf isn’t really the best way to do this; we’ll talk about that in the next class, on strings */&lt;br /&gt;
scanf( “%s”, name );&lt;br /&gt;
for ( i = 0; i &amp;lt; 10; ++i )&lt;br /&gt;
{&lt;br /&gt;
if ( name[i] == ‘a’ )&lt;br /&gt;
{&lt;br /&gt;
printf( “You entered an a!\n” );&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Array Basic Practice:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
Q.1 For all array element of int type:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Sum?&lt;/li&gt;
&lt;li&gt;Average?&lt;/li&gt;
&lt;/ul&gt;Q.2&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Print address of all elements of array[%u]&lt;/li&gt;
&lt;/ul&gt;Q.3 Increment the address of array and print next value&lt;br /&gt;
Hint:&amp;nbsp; K=arr+2;&lt;br /&gt;
Print *k&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-545843672638504979?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/545843672638504979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/c-basic-concepts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/545843672638504979?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/545843672638504979?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/c-basic-concepts.html' title='C Basic Concepts'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;AkUGSX47eCp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-545915892330322719</id><published>2012-03-12T22:57:00.000-07:00</published><updated>2012-03-12T22:57:08.000-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T22:57:08.000-07:00</app:edited><title>Useful Statements</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="entry-content clearfix"&gt;                                                              &lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;i&gt;&lt;b&gt;Break&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;continue&lt;/b&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;switch&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="entry-content clearfix" style="text-align: left;"&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;h1 class="post-title entry-title"&gt;    break           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T01:32"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;Break Statement in c Programming&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;#include&amp;lt;stdio.h&amp;gt;
int main()
{
int i; i = 0;
while ( i &amp;lt; 10 )
{
i++;
if ( i == 5)
break;
Printf(“%d”,i);
}
return 0;
}&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;To exit a loop you can use the break&lt;br /&gt;
statement at any time&lt;/li&gt;
&lt;li&gt;This can be very useful if you want to&lt;br /&gt;
stop running a loop because a condition&lt;br /&gt;
has been met other than the loop end&lt;br /&gt;
condition.&lt;/li&gt;
&lt;li&gt;Break takes the control out of the loop.&lt;/li&gt;
&lt;li&gt;IF I==5 is true then break is executed so&lt;br /&gt;
next statement printf(“”) will not&lt;br /&gt;
execute.&lt;/li&gt;
&lt;/ul&gt;&lt;h1 class="post-title entry-title"&gt;    Continue           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T01:34"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;continue ststement in C programming&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;#include&amp;lt;stdio.h&amp;gt;
int main()
{
int i; i = 0;
while ( i &amp;lt; 10 )
{
i++;
if ( i == 5)
continue;
printf(“%d”,i);
}
return 0;
}&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;“Continue” statement skips the rest of&lt;br /&gt;
the commands in the current loop and&lt;br /&gt;
start from the top again.&lt;/li&gt;
&lt;li&gt;It is not restart.&lt;/li&gt;
&lt;li&gt;In the example above, the printf&lt;br /&gt;
function is never called because of the&lt;br /&gt;
“continue;”.&lt;/li&gt;
&lt;li&gt;Don’t forget to increment the counter.&lt;/li&gt;
&lt;/ul&gt;&lt;h1 class="post-title entry-title"&gt;    switch           &lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;                                    &lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-29T01:38"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;switch Statement in C Programming&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;it is used when you want to selectively&lt;br /&gt;
execute one action among multiple&lt;br /&gt;
actions. &lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;&lt;ul&gt;&lt;li&gt;The switch statement is more easily&lt;br /&gt;
read than multiple if…else statements&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;Switch(switch_expr)
{
case constant_expr1 :
S1;
break;
case constant_expr2 :
S2;
break;
default :
S3;
break;
}&lt;/pre&gt;&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;
main()
{
int i,n;
scanf("%d",&amp;amp;n);
for(i = 1; i&amp;lt;n; i= i+1)
{
switch(i%2)
{
case 0 : printf("the number %d is even
\n",i);
break;
case 1 : printf("the number %d is odd
\n",i);
break;
}
}
}&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;When control transfers to the switch&lt;br /&gt;
statement then switch_expr is&lt;br /&gt;
evaluated and the value of the&lt;br /&gt;
expression is compared with&lt;br /&gt;
constant_expr using the equality&lt;br /&gt;
operator. &lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If the value is equal, the corresponding&lt;br /&gt;
statements are executed. &lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If break is not used, then next case&lt;br /&gt;
statements are also executed. &lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If break is used, only matched case is&lt;br /&gt;
executed and control moves out of the&lt;br /&gt;
switch statement. &lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If the value of switch_expr does not&lt;br /&gt;
match that of constant_expr1, then it is&lt;br /&gt;
compared with the next&lt;br /&gt;
constant_expr2. If no values match, the&lt;br /&gt;
statements in default are executed. &lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The ‘default’ is optional&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="entry-content clearfix"&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;                     &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-545915892330322719?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/545915892330322719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/useful-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/545915892330322719?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/545915892330322719?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/useful-statements.html' title='Useful Statements'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DU4GQXc6eCp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-4498543734251331745</id><published>2012-03-12T22:52:00.000-07:00</published><updated>2012-03-12T22:52:00.910-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T22:52:00.910-07:00</app:edited><title>do while loop</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;pre&gt;&lt;strong&gt;do while loop:&lt;/strong&gt;&lt;/pre&gt;&lt;pre&gt;do
{
//do something;
}
while (expression);&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;&amp;nbsp;Do something first and then test if we&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;have to continue.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; Loop always runs atleast once.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;There is a semi-colon behind the while &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;line.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;If the condition is true, we jump back to&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;the beginning of the block and execute &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;it again&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;&lt;span style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="line-height: 21px;"&gt;
&lt;/span&gt;&lt;/span&gt;#include&amp;lt;stdio.h&amp;gt;
int main()
{
int count, howmuch;
scanf("%d", &amp;amp;howmuch);
count = 0;
do
{
count++;
printf("%d\n", count);
}
while ( count &amp;lt; howmuch);
return 0;
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-4498543734251331745?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/4498543734251331745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/do-while-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4498543734251331745?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4498543734251331745?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/do-while-loop.html' title='do while loop'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DU8MQHszcSp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-7940812639712816427</id><published>2012-03-12T22:51:00.002-07:00</published><updated>2012-03-12T22:51:21.589-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T22:51:21.589-07:00</app:edited><title>While Loop</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;pre&gt;&lt;strong&gt;While Loop&lt;/strong&gt;&lt;/pre&gt;&lt;pre&gt;while loop can be used if you don’t
know how many times a loop must run.
#include&amp;lt;stdio.h&amp;gt;
int main()
{
int count, howmuch;
scanf("%d", &amp;amp;howmuch);
counter = 0;
while ( count &amp;lt; howmuch)
{
count++;
printf("%d\n", count);
}
return 0;
}&lt;/pre&gt;&lt;pre&gt;1. First you must always initialize the
counter before the while loop starts .
2. Then the while loop will run if the
variable “count” is smaller then the
variable “howmuch”.
3. A last thing you have to remember is to
increment the count inside the loop
(count++).
4. Infinite loop?&lt;/pre&gt;&lt;pre&gt;Notice that a while loop is like a
stripped-down version of a for loop-- it
has no initialization or update section.&lt;/pre&gt;&lt;pre&gt;An empty condition is not legal for a
while loop as it is with a for loop.&lt;/pre&gt;&lt;pre&gt;An example&lt;/pre&gt;&lt;pre&gt;While(player != dead)
{
Play();
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-7940812639712816427?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/7940812639712816427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/while-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/7940812639712816427?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/7940812639712816427?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/while-loop.html' title='While Loop'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DU8GR308eyp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-6878274783027858020</id><published>2012-03-12T22:50:00.002-07:00</published><updated>2012-03-12T22:50:26.373-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T22:50:26.373-07:00</app:edited><title>Loops:For Loop</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;pre&gt;&lt;strong&gt;LOOPS in C programming&lt;/strong&gt;
There are three basic types of loops which are:
1. “for loop”
2. “while loop”
3. “do while loop”&lt;/pre&gt;&lt;blockquote&gt; &lt;ul&gt;&lt;li&gt;The for loop is used for repeating the execution of certain statements&lt;/li&gt;
&lt;li&gt;while loop can be used if you don’t know how many times a loop must run&lt;/li&gt;
&lt;li&gt;The do…while loop is used when you want to make at least one iteration&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; While writing the loop body, you  have to be careful to decide whether the loop variable is updated at the  start of the body or at the end of the body.&lt;br /&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;&lt;strong&gt;For LOOP&lt;/strong&gt;&lt;br /&gt;
&lt;code&gt;#include&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
for(int i = 0; i {&lt;br /&gt;
printf("the numbers are %d \n", i);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/code&gt;&lt;/blockquote&gt;&lt;blockquote&gt;There are three parts that are separated by&lt;br /&gt;
semi-colons in control block of the C for loop.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;initialization: initialization_expression is executed&lt;br /&gt;
before execution of the loop starts. The&lt;br /&gt;
initialization_expression is typically&lt;br /&gt;
used to initialize a counter for the&lt;br /&gt;
number of loop iterations. You can&lt;br /&gt;
initialize a counter for the loop in this&lt;br /&gt;
part.&lt;/li&gt;
&lt;li&gt;loop_condition :The execution of the&lt;br /&gt;
loop continues until the loop_condition&lt;br /&gt;
is false. This expression is checked at&lt;br /&gt;
the beginning of each loop iteration.&lt;/li&gt;
&lt;li&gt;The increment_expression, is usually&lt;br /&gt;
used to increase (or decrease) the loop&lt;br /&gt;
counter. This part is executed at the&lt;br /&gt;
end of each loop iteration.&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;code&gt;for (expr1; expr2; expr3)&lt;br /&gt;
{&lt;br /&gt;
s1;&lt;br /&gt;
s2 ; // repeat section&lt;br /&gt;
}&lt;/code&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;expr1 is executed only once, the first&lt;br /&gt;
time the for loop is invoked.&lt;/li&gt;
&lt;li&gt;expr2 is executed each time before the&lt;br /&gt;
execution of the repeat section&lt;/li&gt;
&lt;li&gt;When expr2 is evaluated false, the loop&lt;br /&gt;
is terminated and the repeat section is&lt;br /&gt;
not executed.&lt;/li&gt;
&lt;li&gt;After execution of stmts inside the&lt;br /&gt;
block, expr3 is executed. Generally, this&lt;br /&gt;
is the expression that is used to ensure&lt;br /&gt;
that the loop will be terminated after&lt;br /&gt;
certain iterations&lt;/li&gt;
&lt;li&gt;The for loop is used for repeating the&lt;br /&gt;
execution of certain statements&lt;/li&gt;
&lt;li&gt;Generally, you have to specify any three&lt;br /&gt;
expressions in the for loop&lt;/li&gt;
&lt;li&gt;The statements that you want to repeat&lt;br /&gt;
should be written in the repeat section.&lt;/li&gt;
&lt;li&gt;While writing expressions, ensure that&lt;br /&gt;
expr2 is evaluated to be false after&lt;br /&gt;
certain iterations; otherwise your loop&lt;br /&gt;
will never be terminated, resulting in&lt;br /&gt;
infinite iterations.&lt;/li&gt;
&lt;li&gt;A single instruction can be placed&lt;br /&gt;
behind the “for loop” without the curly&lt;br /&gt;
brackets.&lt;/li&gt;
&lt;li&gt;For instance you want to print the same&lt;br /&gt;
words ten times. You could type ten&lt;br /&gt;
printf function, but it is easier to use a&lt;br /&gt;
loop.&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;code&gt;#include&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
int i,n;&lt;br /&gt;
scanf("%d",&amp;amp;n);&lt;br /&gt;
for(i = 0; i {&lt;br /&gt;
printf("the numbers are %d \n",i);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;i++ is same as using i = i +1;&lt;/li&gt;
&lt;li&gt;i– is same as using i=i-1;&lt;/li&gt;
&lt;li&gt;need not to start from zero.&lt;br /&gt;
loop like this (i=1;i&lt;/li&gt;
&lt;li&gt;Infinite loop?&lt;/li&gt;
&lt;li&gt;variable initialization allows you to&lt;br /&gt;
either declare a variable and give it a&lt;br /&gt;
value or give a value to an already&lt;br /&gt;
existing variable&lt;/li&gt;
&lt;li&gt;Notice that a semicolon separates each&lt;br /&gt;
of these sections,&lt;/li&gt;
&lt;li&gt;Also note that every single one of the&lt;br /&gt;
sections may be empty, though the&lt;br /&gt;
semicolons still have to be there.&lt;/li&gt;
&lt;li&gt;If the condition is empty, it is evaluated&lt;br /&gt;
as true and the loop will repeat until&lt;br /&gt;
something else stops it.&lt;/li&gt;
&lt;/ul&gt;An Example of for loop&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
#include&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int max = 5;&lt;br /&gt;
int c = 0;&lt;br /&gt;
//omit the firstand last expr&lt;br /&gt;
for(;c &amp;lt; max;) { c++; printf("c = %d\n",c); } /* omit all  expressions*/ int i = 0; for(;;) { i++; /* use break to escape the  loop*/ if(i &amp;gt; max)&lt;br /&gt;
break;&lt;br /&gt;
printf("i = %d\n",i);&lt;br /&gt;
}&lt;br /&gt;
return 0;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-6878274783027858020?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/6878274783027858020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/loopsfor-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/6878274783027858020?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/6878274783027858020?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/loopsfor-loop.html' title='Loops:For Loop'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DUAMQXs5cCp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-4001472582194760183</id><published>2012-03-12T22:49:00.002-07:00</published><updated>2012-03-12T22:49:40.528-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T22:49:40.528-07:00</app:edited><title>CONTROL STATEMENT [ IF]</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;pre&gt;CONTROL STATEMENT [ IF]
#include &amp;lt;stdio.h&amp;gt;
void main()
{
int i=0;
If(i==0)
{
i=5;
}
printf(“%d”, i);
}&lt;/pre&gt;&lt;blockquote&gt; &lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;== comparison opr.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt; expr is a Boolean expression that&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;returns true (nonzero) or false (zero).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;In C, the value nonzero is true while&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;zero is taken as false.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;If left side is equal to right side then it&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;return true&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; font-style: normal; line-height: 21px; white-space: pre;"&gt;Condition is true then control goes &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;inside the block and execute the&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;statements.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt; Also check i&amp;lt;=j; i&amp;gt;=j; i!=j; &amp;lt;; &amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;
void main()
{
int i=0;
If(i==0) i=5;
printf(“%d”, i);
}
 If(i==0) i=5;
 If you want to execute only one
statement, opening and closing braces
are not required.
#include &amp;lt;stdio.h&amp;gt;
void main()
{
int i=5;
If(i&amp;lt;4)
{
i =i +6 ;
}
else
{
//write your stmt here
}
printf(“%d”, i);
}&lt;/pre&gt;&lt;pre&gt;void main()
{
int i=5;
If(i&amp;lt;4)
{//stmts }
else if(i&amp;gt;6)
{ //write your stmt here}
else
{//stmts }
printf(“%d”, i);
}&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt; The else part is optional.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt; If the “if” condition is true then the&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;part that is enclosed after the if is&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;executed&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;&amp;nbsp;If the “if” condition is false then the&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt;else part is executed&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-size: 15px; line-height: 22px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;“else if” takes a expression like “if”&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; “else if” checks the expression and if it &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;is true the block is executed&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; “else” does not take any expression. So &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;it will be executed when the “if” &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;condition is false.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;(5)// a non-zero value returns True.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; (0)// zero value returns False.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; (i==0) // True if i=0 otherwise False.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; (i = 0) // False because value of the &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;expression is zero.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; If a compound statement is provided, it &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;must be enclosed in opening and &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;closing braces.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;“if” is used when a question requires a &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;yes or no answer.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; If you want to choose an answer from &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;several possibilities then use the &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;“switch” statement.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;if (a&amp;gt;b)&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;i = i + 1;&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;j = j + 1;&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;Q. What will happen:&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;• If condition is true?&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;• If condition fails ?&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; You can use if-else if when you want to&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;check several conditions but still&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;execute one statement.&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; When writing an if-else if statement, be&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;careful to associate your else statement&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;to the appropriate if statement.&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; You must have parentheses around the&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;condition.&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; You must have a semicolon or right&lt;/span&gt;&lt;br style="background-color: #f7f7f7; font-size: 15px; white-space: pre;" /&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt;brace before the else statement.&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-4001472582194760183?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/4001472582194760183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/control-statement-if.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4001472582194760183?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/4001472582194760183?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/control-statement-if.html' title='CONTROL STATEMENT [ IF]'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DUEEQX8_fyp7ImA9WhVSFkw.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-7701327820918111431</id><published>2012-03-12T22:46:00.000-07:00</published><updated>2012-03-12T22:46:40.147-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T22:46:40.147-07:00</app:edited><title>Input from user  in C</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="entry-content clearfix"&gt;                                                             &lt;strong&gt;INPUTTING FROM USER&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;#include&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
int i;&lt;br /&gt;
scanf(“%d”, &amp;amp;i); // take input from user&lt;br /&gt;
printf(“the number is %d \n”, i);&lt;br /&gt;
}&lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class="Apple-style-span" style="font-size: 16px; line-height: 24px;"&gt;&amp;nbsp;scanf(“%d”,&amp;amp;i);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&amp;nbsp;Takes the input from user&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Program waits for the user input&lt;/li&gt;
&lt;li&gt;&amp;nbsp;In scanf, you have to specify the address of the variable, &amp;nbsp;as &amp;amp;i&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; The address is the memory location&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; where a variable is stored.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; Scanf takes two parameters 1. format&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; specifier 2. address of variable&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; &amp;amp;I denotes the memory address of&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; variable i&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; Finally it is a statement so use ;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; Stdio.h knows how to use scanf&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; Printf(“the number is %d\n”, i);&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="background-color: #f7f7f7; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; white-space: pre;"&gt; Prints the value of variable i&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;blockquote&gt; &lt;pre&gt;&lt;strong&gt;MULTIPLE INPUTS&lt;/strong&gt;
#include &amp;lt;stdio.h&amp;gt;
main()
{
int I, j, k;
scanf("%d%d",&amp;amp;i, &amp;amp;j); // multiple input
k = i + j;
printf("sum of two numbers is %d \n",k);
}&lt;/pre&gt;&lt;/blockquote&gt;&lt;pre&gt;&lt;span style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="line-height: 21px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;strong&gt; scanf("%d%d",&amp;amp;i,&amp;amp;j);&lt;/strong&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt; List of format specifiers without ,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt; List of variable with ,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px;"&gt; The number of format specifiers must be the same as the number of variables&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-7701327820918111431?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/7701327820918111431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/input-from-user-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/7701327820918111431?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/7701327820918111431?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/input-from-user-in-c.html' title='Input from user  in C'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;CkMBSXw8eyp7ImA9WhVSFk8.&quot;'><id>tag:blogger.com,1999:blog-4776847991909640545.post-516755399471983521</id><published>2012-03-12T22:43:00.002-07:00</published><updated>2012-03-12T23:34:18.273-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-03-12T23:34:18.273-07:00</app:edited><title>C programming....</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h1 class="post-title entry-title" style="font-weight: normal;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/h1&gt;&lt;div class="post-meta clearfix"&gt;&lt;span class="updated"&gt;              &lt;span class="value-title" title="2011-11-27T18:31"&gt;             &lt;/span&gt;                     &lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcT9pRjkOV4HpI_08D4EFhDvadWN63pKMbc2UKhf-qjyn3NcA-cO" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcT9pRjkOV4HpI_08D4EFhDvadWN63pKMbc2UKhf-qjyn3NcA-cO" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;Compiler :-&lt;/b&gt;&lt;br /&gt;
Source code——-machine code&lt;br /&gt;
Example gcc&lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;b&gt;IDE :- &lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  INTEGRATED DEVELOPMENT ENVIRONMENT&lt;br /&gt;
An  IDE is a software application that generally comprises a code editor,  a  compiler, a debugger, as well as all sorts of tools to help manage   complex projects. &lt;/blockquote&gt;&lt;blockquote&gt;TEXT EDITOR&lt;br /&gt;
knows a lot about programming&lt;br /&gt;
Recognize syntax error/highlight&lt;br /&gt;
Completes code for you&lt;br /&gt;
Compile and interpret your code&lt;br /&gt;
Break points: stop the code at break point during execution&lt;br /&gt;
Can have a look at assembly codes and hence registers.&lt;br /&gt;
Example : Eclipse, Visual Studio &lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;SDK (Software Development Kit) :-&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  An SDK is a broader term encompassing any set of development tools,   sometimes including an IDE, sometimes not. The DirectX SDK is a huge   class library, a huge pile of documentation, and a few tools.&lt;br /&gt;
An IDE is used to actually write and test programs. An SDK is what adds functionality to those programs.&lt;br /&gt;
Example : Eclipse, Visual Studio, DIRECTX SDK &lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;FRAMEWORK&lt;/b&gt;&lt;br /&gt;
People  write lots of libraries to allow you to do things easily, in the   language you are using. These libraries are vast, and cover a very   comprehensive set of application, they get called a framework&lt;br /&gt;
Ex.Dot net Framework-4 &lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;API&lt;/b&gt;&lt;br /&gt;
Application Programming Interface&lt;br /&gt;
Set of functions that you can call&lt;br /&gt;
is the interface you can interact with.[by codes] &lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;OS&lt;br /&gt;
&lt;/b&gt; A program that acts as an intermediary between a user of a computer and the computer hardware.&lt;br /&gt;
Operating system goals:&lt;br /&gt;
Execute user programs and make solving user problems easier.&lt;br /&gt;
Make the computer system convenient to use.&lt;br /&gt;
Use the computer hardware in an efficient manner&lt;br /&gt;
Windows,linux,mac, backtrack[hacking os] &lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;b&gt;POPULAR MOBILE OS&lt;/b&gt;&lt;br /&gt;
PHONE 7&lt;br /&gt;
ANDROID&lt;br /&gt;
Symbian OS (Nokia)&lt;br /&gt;
Bada (Samsung Electronics)&lt;br /&gt;
BlackBerry OS (Research In Motion)&lt;br /&gt;
iPhone OS / iOS (Apple)&lt;br /&gt;
MeeGo OS (Nokia and Intel)&lt;br /&gt;
Palm OS (Garnet OS)&lt;br /&gt;
webOS (Palm/HP)&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4776847991909640545-516755399471983521?l=tautorials.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tautorials.blogspot.com/feeds/516755399471983521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tautorials.blogspot.com/2012/03/c-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/516755399471983521?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4776847991909640545/posts/default/516755399471983521?v=2'/><link rel='alternate' type='text/html' href='http://tautorials.blogspot.com/2012/03/c-programming.html' title='C programming....'/><author><name>Prakash Saurabh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-qRKomtwxAVA/AAAAAAAAAAI/AAAAAAAAAOw/uIbkeyDPvU4/s512-c/photo.jpg'/></author><thr:total>0</thr:total><georss:featurename>Uttar Pradesh, India</georss:featurename><georss:point>25.935817364049864 80.17272911718749</georss:point><georss:box>22.665419364049864 76.3817841171875 29.206215364049864 83.96367411718748</georss:box></entry></feed>