C language Code Snippets

Source Code
/*
programming
c programming
c language is a compilar base language
program
Data + structure
*/

//basic structure of c language

//#include
//#include
//int addition(int num1,int num2);
//int main(){
//	
//	display any output you will use printf() funtion in c program
//	printf("hello world \n");
//	printf("hello world \n%c ",'b');
	
	
////	variables
//	data_type var_name=value;
//	int var;
//	float var1;
//	char var2;
//	char* var3;
//	var=12;
//	var1=34.12;
//	var2='a';
//	var3="string";
//	printf("%d\n%f\n%c\n%s",var,var1,var2,var3);
	
//	scanf() is used get input
//	char* integer;
//	scanf("%s",&integer);
//	printf("%s",&integer);

//	array is used for storing multiple data of same data type
//	data type arr_name[size]={};
//	int arr_int[12]={1,2};
//	float arr_float[10]={11.5,5.5};
//	char arr_char[5]={'a','b','c'};
//	char* arr_string[5]={"abc","string12","txt"};
//	printf("%d\n",arr_int[0]);
//	printf("%f\n",arr_float[0]);
//	printf("%c\n",arr_char[0]);
//	printf("%s",arr_string[0]);

//	sequence structures
//	printf("helow world1\n");
//	printf("helow world2\n");
//	printf("helow world3\n");
//	printf("helow world4\n");
//	printf("helow world5\n");
//	printf("helow world6\n");
//	printf("helow world7\n");
//	printf("helow world8");

//	Decision structure
//	if(condition){
//		block of statements run hon gi;
//	}
//	else{
//		this block will run if condition will be flase
//	}
//	if(1==2){
//		printf("yes");
//	}
//	else{
//		printf("no");
//	}
//	if(1==1){
//		printf("outor  if is true!\n");
//	if(2==4){
//		printf("inner if is true.");
//	}
//	}
	
//	Repitetion structures
//	while loop , do while loop , for loop
//	while(condition){
//		block will runk
//	}
//	int x=1;
//	while(x==1){
//		scanf("%d",&x);
//	}
	
//	int x=12;
//	do{
//		scanf("%d",&x);
//	}while(x==1);

//	for(int i=1;i<=10;i++){
//		printf("hello world %d\n",i);
//	}

//	funtion
//	int var=addition(12,112);
//	printf("%d",var);
	
	
//	return 10;
}
//int addition(int num1,int num2){
//	int sum=num1+num2;
//	return sum;
//}

Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Contact form