Saturday, August 16, 2014

BCA LECTURE-1 C PROGRAMMING



C Programming
Practical Concept
Variable | Data type | Constant
It is used to store value.
m=78;
78 is value
m is variable

a=8.90;
a is variable
8.90 is value

nm=”ashok sir”;
name is always within double quotes.
nm is variable

gender=’M’;
character is always within single quotes.
gender is variable

integer value
float value
string value
character value


datatype
int   %d           float  %f         char  %c
string (character array) %s 

int a; //integer constant
a=78; //correct
a=7.89; //incorrect

float b; //float constant
b=45; //incorrect
b=5.78; //correct

char g; //character constant
g=m; //incorrect
g=f; //incorrect
g=’m’; //correct
g=”f”; //incorrect

//string constant
char nm[20]=”ashok roshan”; //character array or string

string is not datatype in C programming language, string is combination of character that is called character array or string


Rules of Variable name
1.  It can’t begins with numeric.
1m //incorrect
m1 //correct
2.  Space not allowed in variable name
basicsal //correct
basic sal //inccorect
3.  Only _ symbol allowed
basic_sal //correct
basic@sal //incorrect
4.  Reserve word (keyword) can not used as variable name.

Dennis Ritchie is developer of C programming  in 1972 at USA, AT & T Lab (Advance Technology & technique)

BASIC – Beginer All purpose symbolic instruction code

extention of C program file is .c

write C program to display C is procedural Programming language

No comments:

Post a Comment

JAC Board Computer || IIT 2025 || Introductory Information Technology || Class 10 || Practical Examination 2025

Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...