printf double and float with %f and scanf for float %f double %lf
This commit is contained in:
		
							
								
								
									
										21
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								ChangeLog
									
									
									
									
									
								
							@@ -1,5 +1,26 @@
 | 
				
			|||||||
2024-10-29  Mert Gör  <mertgor@masscollabs.xyz>
 | 
					2024-10-29  Mert Gör  <mertgor@masscollabs.xyz>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* c-basic/d-f.c: #include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  float f;
 | 
				
			||||||
 | 
					  double d;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  printf("enter a float number: \n");
 | 
				
			||||||
 | 
					  scanf("%f", &f);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  printf("enter a double number: \n");
 | 
				
			||||||
 | 
					  scanf("%lf", &d);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  printf("f = %f, d = %f \n", f , d);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* c-basic/hello.c (main): Hello World Example which is forgotten at start
 | 
						* c-basic/hello.c (main): Hello World Example which is forgotten at start
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* c-basic/hex.c: Experımental Branch page 21
 | 
						* c-basic/hex.c: Experımental Branch page 21
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								c-basic/d-f.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								c-basic/d-f.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  float f;
 | 
				
			||||||
 | 
					  double d;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  printf("enter a float number: \n");
 | 
				
			||||||
 | 
					  scanf("%f", &f);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  printf("enter a double number: \n");
 | 
				
			||||||
 | 
					  scanf("%lf", &d);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  printf("f = %f, d = %f \n", f , d);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user