Skip to content
/ sprintf Public

An attempt at coding a reduced version of C language sprintf version

License

Notifications You must be signed in to change notification settings

janus/sprintf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

sprintf

######An attempt at coding a reduced version of C language sprintf version

######The below is what I want to model but in the class of sprintf and not printf

printf(":%s:\n", "Hello, world!");
printf("Hello, world!");
printf(":%15s:\n", "Hello, world!");
printf(":%.10s:\n", "Hello, world!");
printf(":%-10s:\n", "Hello, world!");
printf(":%-15s:\n", "Hello, world!");
printf(":%.15s:\n", "Hello, world!");
printf(":%15.10s:\n", "Hello, world!");
printf(":%-15.10s:\n", "Hello, world!");
printf("The color: %s\n", "blue");
printf("First number: %d\n", 12345);
printf("Second number: %04d\n", 25);
printf("Float number: %3.2f\n", 3.14159);
int Fahrenheit;
for (Fahrenheit = 0; Fahrenheit <= 300; Fahrenheit = Fahrenheit + 20)
	printf("%3d %06.3f\n", Fahrenheit, (5.0/9.0)*(Fahrenheit-32));
int a,b;
float c,d;
a = 15;
b = a / 2;
printf("%d\n",b);
printf("%3d\n",b);
printf("%03d\n",b);
c = 15.3;
d = c / 3;
printf("%3.2f\n",d);

About

An attempt at coding a reduced version of C language sprintf version

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages