Posts

Showing posts with the label Cprogramming

scanf in c

Image
So what is scanf function in C? What is the use of scanf function in C language? In this post we are going to see the detailed explanation about scanf function and its use in writing a C program. The scanf function is a library function .Library functions are by default declared in the C language. Scanf function in c allows compiler to accept the input given by the user using keyboard and is often referred to as counter part of printf function because printf function is used to display output on the screen whereas it takes input. For us to be able to use scanf() function,it is necessary to use #include<stdio.h> at the beginning of the program.As discussed earlier it is a preprocessor directive and it's objective will be discussed later.For now just remember to use it wherever you are using scanf() function. In C programming the scanf() function is used to read different type of data.The different type of data includes integer,real,character.It is also used t...

"Hello, world!" program||hello world

Image
This post will describe writing the first "hello world" C program using a compiler.Here i am using codeblocks as a compiler tool.You can use any other compiler if you want.A detailed post about various compilers will be given in the next blog post. Here are few things that this post is all about.T his post will be covering all the detailed explanation of how to:  Write a c program: how to write the program in the compiler Its basic components: components here is mainly the syntanx and the function used in the program. How to compile and run the c program: this section will deal with compiling and running the program.I have include links for some compiler you can check out if you don't have any compiler. Output of the given program: as always in the last we are going to see the output of the given program on the screen. This is the simplest program of the c language.The reason why i have included it here is as it is the first program of the c langua...