learn-C-09
char input[81]; //holds a string as long as 80 characters
char *iptr=input; //also could have done this: char *iptr=&input[0];
gets(iptr); //makes sure that iptr points to the string typed by the user.
learn-C-08
1 | int main(void) { |
learn-C-07
#include<math.h>
po2=pow(2.0,2.0);
printf("2 raised to the 2nd power is %.0f\n", po2);
s2=sqrt(49);
printf("The square root of 49 is %.0f\n", s2);
si628=sin(6.28);
print("The sine of 6.28 is %f\n", si628);
r01=rand();
printf("A random number from 1 to 32767 is %f\n", r01);
learn-C-06
`int main(){
int age, intSize;
float gift;
printf(“How old are you?\n”);
scanf(“ %d”, age);
if (age<18)
gift=5.00;
else
gift=10.00;