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

main test-branch
Last change on this file since bb03188 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
Line 
1#include<civlc.cvh>
2#include<stdio.h>
3$input int x;
4$input double y;
5
6char z[5];
7
8int main(int argc, char * argv[]){
9 int i = 58;
10 double d = 33.3333333;
11 float f = 33.333;
12 char * s = "test%dString";
13 double A[2];
14
15 printf("d is %Lf\n", d);
16 printf("d is %lf\n", d);
17 printf("test0 aabb\r\n");
18 printf("test1 aa\nbb aa\bbb aa\tbb \' \" \n");
19 printf("test2 %d, %o, %x \n", i,i,i);
20 printf("test3 %.16f,%e,%g,%a\n", d,d,d,d);
21 printf("test4 %.8f,%*e,%g,%a\n", f,f,f,f);
22 printf("test5 %d,%s\n", i-20,s);
23 printf("test6 %d,%.16f,%s\n", x,y,z);
24 printf("test7 %d\n", &x);
25 printf("test8 %f\n", A[0]);
26 printf("test9 %%f, %d, %s, %.*f, %s%s%d%s\n", d, s, f, (s+1), (s+2), d, (s+3));
27}
Note: See TracBrowser for help on using the repository browser.