1.7- sizeof() Function In C Programming Language | c language tutorial for beginners
What is the sizeof() function in C? The sizeof() function in C is a built-in function that is used to calculate the size (in bytes)that a data type occupies in the computer's memory. A computer's memory is a collection of byte-addressable chunks.
sizeof function in C programming language is used to evaluate the size of data type,variable.
sizeof operators looks like function still it is considered as operator in c programming.
#cprogrammingLanguage
#cprogramming
#cprogrammingLanguageinhindi
#cprogrammingLanguage
#ugcnetcprogrammingLanguage
#gatecprogrammingLanguage
#cprogrammingLanguagetutorials
#cprogrammingtutorials
#cprogrammingLanguagelectures
#cprogramminglectures
c language in hindi,
c programming in hindi,
learn c in hindi,
c in hindi,
c language tutorial for beginners in hindi,
c programming for beginners in hindi,
c language full course in hindi,
learn c programming in hindi,
1.6- scanf() function In C Programming Languages | c language tutorial for beginners | scanf() in c
The printf() and scanf() functions are used for input and output in C language. Both functions are inbuilt library functions, defined in stdio.h (header file).
printf() function
The printf() function is used for output. It prints the given statement to the console.
The syntax of printf() function is given below:
printf("format string",argument_list);
The format string can be %d (integer), %c (character), %s (string), %f (float) etc.
scanf() function
The scanf() function is used for input. It reads the input data from the console.
scanf("format string",argument_list);
Program to print cube of given number
Let's see a simple example of c language that gets input from the user and prints the cube of the given number.
int main(){
int number;
printf("enter a number:");
scanf("%d",&number);
printf("cube of number is:%d ",number*number*number);
return 0;
}
Output
enter a number:5
cube of number is:125
The scanf("%d",&number) statement reads integer number from the console and stores the given value in number variable.
The printf("cube of number is:%d ",number*number*number) statement prints the cube of number on the console.
Program to print sum of 2 numbers
Let's see a simple example of input and output in C language that prints the addition of 2 numbers.
int main(){
int x=0,y=0,result=0;
printf("enter first number:");
scanf("%d",&x);
printf("enter second number:");
scanf("%d",&y);
result=x+y;
printf("sum of 2 numbers:%d ",result);
return 0;
}
Output
enter first number:9
c language ugc net,
ugc net c programming,
ugc net computer science c programming,
gate c programming,
gate c programming lecture,
Playlist:
C Programming Language Practical Tutorials | All University Exam- UGC NET- Gate C Language Tutorials
• C Language Practical Tutorials in hindi | ...
[With Notes] C Programming Language Tutorials- All University Exam- UGC NET- Gate C Language Tutorials
• [With Notes] C Programming Language Tutori...
1.1- What Is C Preprocessor Directives in c language | c programming language tutorials • 1.1- C Preprocessor Directives In C Langua...
1.2- What Is C Preprocessor Directives in c language | c programming language tutorials • 1.2- What Is C Preprocessor Directives in ...
1.3- Execution Phases in C Programming Language | c programming language • 1.3- Execution Phases in C Programming Lan...
1.4- Escape Sequences In C Language | C Programming Language For Beginners • 1.4- Escape Sequences In C Language | C Pr...