C language with code
C language
Background
C is a general- purpose programming language. In the early 1970s the C programing language was designed and enforced by Dennis Ritchie at Bell Laboratores on a DEC PDP that used the UNIX operating system,
Scope C language
C Programming Language is very fashionable computer programming language through which users and computers can communicate .Anyone can learn C Programming Language from the basics. Every topic in this blog is explained with clear information and good examples.
Q.N,- Using the c language print the "hello!".
code:
#include<stdio.h>
void main()
{
printf("hello!"); //printf is name of main C output funtions
}
output-
hello!
--------------------------------
Character Set in c language
As every language contains a group of characters used to construct words, statements etc.
c language supports a total of 256 characters
they are given in below-
Q.n2- Character Set of C language contains?
i) Alphabets ii) Digits
iii) Special Symbols iv)All of these
Ans-iv) All of these
Data types in C programing
C programing language, a data types are often defined as a group of values with similar characteristics.
1.) Basic Data types(Primary Data type)
Primary data types also are called as Built-In data types. In below explained the type of primary data types in c programming-
i) Integer data type-
The integer data type may be a set of whole numbers. Every integer value doesn't have the decimal value. We use the keyword "int" to reprsent integer data type in c.
In c programing "%d" is used to print the integer data type.
Q.N. Write a program to print integer data type in c language .
code input:
#include<stdio.h>
void main()
{
int a=10; // declaration of integer data type
printf("%d",a);
}
output;-
10
--------------------------------
ii) Floating point data type
floating-point data types are a group of numbers with the decimal value. Every floating-point value must contain the decimal value. We use the keyword "float" to represent floating data type. Size of float data type is 4 bytes. Fromat Specifier is "%f" to print the float data type
Q.N. write a program to print float data type .
code input:
#include<stdio.h>
void main()
{
float a=10.2;
printf("%f",a);
}
output:-
10.200000
--------------------------------
Comments
Post a Comment