int main()
{
// test programme - char assign
printf("\n Hell0 friends\n i am musab \n its my first work on char assign \n hope u will like this \n\n ");
/* its my first work on char assign
hope u will like this
Note: its a multi line comment*/
float num1, num2;
double val;
char ch;
printf("enter the first number : ");
scanf("%f",&num1);
printf("enter another number : ");
scanf("%f",&num2);
ch='+';
val=num1+num2;
printf("%0.2f %c %0.2f= %0.2lf\n",num1,ch,num2, val);
ch='-';
val=num1-num2;
printf("%0.2f %c %0.2f= %0.2lf\n",num1,ch,num2, val);
ch='*';
val=num1*num2;
printf("%0.2f %c %0.2f= %0.2lf\n",num1,ch,num2, val);
ch='/';
val=num1/num2;
printf("%0.2f %c %0.2f= %0.2lf\n",num1,ch,num2, val);
return 0;
}

No comments:
Post a Comment