2. What is programming?
Input:
A command which is
given by the
programmer
e.g.
We are EEE family
(We want to print out
what we’ve written)
Processing Unit:
Analysing the command
Converting input command in
binary data
Process the binary command
Converting to aspect result
e.g.
i. We are EEE family = 0101…..
ii. Process 0101……
iii. 0101= We are EEE family
Output:
Result of the process
e.g.
We are EEE family
(Computer’ve printed
out what we had
wanted to write)
2
3. What is compiler?
Compilers we specially require:
• Code-blocks (for c or c++ programming)
• Net-Beans (for Java or Android programming)
3
5. General knowledge of C coding:
CODING:
5
#include <stdio.h>
//include standard input & output numbers
#include <stdlib.h>
//include standard library numbers
int main()
// main function , integer type ,not including any arguments
{
printf(" ");
// means new line
return 0;
//main function doesn’t return any value
}
7. Data types:
7
Bytes Required:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
float b;
char c;
int s1,s2,s3;
s1=sizeof(a);
s2=sizeof(b);
s3=sizeof(c);
printf ("%d %d %d ",s1,s2,s3);
return 0;
}
An integer requires 4 bytes
of Memory
A float requires 4 bytes of
Memory
A character requires 1 byte
of Memory
A string requires (x + Null)
bytes . Here x is its total
bytes of characters
8. Some important Functions & Features:
8
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for (i=0;i<10;i++)
{
printf("%dn",i);
}
for (i=9;i>=0;i--)
{
printf("%dn",i);
}
return 0;
}
9. 9
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=0;
while(i<10)
{
printf("%dn",i);
i++;
}
int y=1;
while(y==1)
{
printf("while function is working n");
printf("Press 1 to continue else any key to close:");
scanf("%d",&y);
}
return 0;
}