Skip to main content

Posts

Showing posts from March, 2021

C Programming Basics

  Keywords Keywords are predefined, reserved words used in programming that have special meanings. ex:- int money; Here, int is a keyword that indicates money is a variable of type int (integer). Identifiers Identifier refers to name given to entities such as variables, functions, structures etc. Variables In programming, a variable is a container (storage area) to hold data. ex:- int playerScore = 95; Here, playerScore is a variable of int type Constants If you want to define a variable whose value cannot be changed, you can use the const keyword. ex:- const double PI = 3.14; Data Types Data types are declarations for variables.This determines the type and size of data associated with variables. Input Output (I/O) use scanf() function to take input from the user, and printf() function to display output to the user #include <stdio.h> int main() { int a; float b; printf("Enter integer and then a float: "); // Taking multiple inputs scanf("%d%f", &a, &b)

C Programming Introduction

  hi friends! Before we depth into c program let us understand, what is programming Programming is the process of creating a set of instructions that tell a computer how to perform a task.Programming can be done using a variety of computer programming languages, such as JavaScript, Python, and C++, PHP, react native, etc. ex:- websites are developed using php mobile application can be developed using reactnative etc Depending on application type, we choose different programming languages to develop it. Let us see an example of c programming to print "hello world" on screen program #include <stdio.h> int main() { /* Our first simple C basic program */ printf("Hello World! "); return 0; } output Hello World! run the code on online compiler https://www.onlinegdb.com/online_c_compiler or install c compiler on system and run c programs. C Basic commands Explanation #include <stdio.h> This is a preprocessor command that include