First Method:
#include <stdio.h>
int main() {
float s, b, ns;
printf("Enter salary:");
scanf("%f", &s);
b = s * 0.50;
ns = s + b;
printf("Net Salary = %.2f", ns);
return 0;
}
#include <stdio.h>
int main() {
float s, b, ns;
printf("Enter salary:");
scanf("%f", &s);
b = s * 0.50;
ns = s + b;
printf("Net Salary = %.2f", ns);
return 0;
}
Second Method:
#include <stdio.h>
int main() {
float ns;
printf("Enter salary:");
scanf("%f", &s);
ns = ns + (ns * 0.50);
printf("Net Salary = %.2f", ns);
return 0;
}
Third Method:
#include <stdio.h>
int main() {
float ns;
printf("Enter salary:");
scanf("%f", &s);
printf("Net Salary = %.2f", ns * 0.5);
return 0;
}
int main() {
float ns;
printf("Enter salary:");
scanf("%f", &s);
printf("Net Salary = %.2f", ns * 0.5);
return 0;
}
No comments:
Post a Comment