Wasim232,
First I will point out that this a c++ forum, it may be hard to get any answers to c questions. That said.
1 2 3
|
Printf("%d*10",x);
Printf("%f/2",y) ;
Printf("%cz*(z+1)");
|
the %d, %f and %c are format specifiers that tell printf how to print the variables. So, the *10 is likely to give you a compile error. I am thinking the way it should read is
printf("%d", x * 10);
this way you are multiplying the variable not the format specifier. The same with line 2. And the last line should be
printf("%c", z * (z + 1)
. I just noticed that your
Printf
s should be all lowercase letters.
I think that will work, it has been to many years since I worked with c.
If you want to read up on printf try this link
http://www.cplusplus.com/reference/cstdio/printf/
As for your inputs you could use the
scanf("%d", &x)
. The
&
is a reference used for regular variables (not sure what that means), but the example was for a variable of type int. Beyond that I would have to do more research.
Hope that gives you more to work with,
Andy
After I posted I noticed the z variable should be one more than you enter, therefore it should be
printf("%c", z + 1)
.