source: CIVL/examples/library/stdio/printf.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 701 bytes
RevLine 
[e6b02c8]1#include<civlc.cvh>
[fc3ff5e]2#include<stdio.h>
[d828d18]3$input int x;
4$input double y;
[e6b02c8]5
6char z[5];
[85d4675]7
8int main(int argc, char * argv[]){
[d828d18]9 int i = 58;
[85d4675]10 double d = 33.3333333;
11 float f = 33.333;
[21cfdbe]12 char * s = "test%dString";
[4533f7eb]13 double A[2];
[d828d18]14
[3b90d48]15 printf("d is %Lf\n", d);
16 printf("d is %lf\n", d);
[0293c3b]17 printf("test0 aabb\r\n");
[d828d18]18 printf("test1 aa\nbb aa\bbb aa\tbb \' \" \n");
[85d4675]19 printf("test2 %d, %o, %x \n", i,i,i);
[d828d18]20 printf("test3 %.16f,%e,%g,%a\n", d,d,d,d);
[0ea48f2]21 printf("test4 %.8f,%*e,%g,%a\n", f,f,f,f);
[0293c3b]22 printf("test5 %d,%s\n", i-20,s);
[d828d18]23 printf("test6 %d,%.16f,%s\n", x,y,z);
[4533f7eb]24 printf("test7 %d\n", &x);
25 printf("test8 %f\n", A[0]);
[0ea48f2]26 printf("test9 %%f, %d, %s, %.*f, %s%s%d%s\n", d, s, f, (s+1), (s+2), d, (s+3));
[85d4675]27}
Note: See TracBrowser for help on using the repository browser.