#include<iostream>
#include<conio.h>
using namespace std;
int main(){
int salary;
float deduction,netpayable;
switch(salary/10000){
cout<<"enter salary amount :";
cin>>salary;
case 0:
deduction=0;
netpayable = salary;
cout<<"netpayable salary is salary-deduction ="<<netpayable;
break;
case 1:
deduction=1000;
netpayable = salary-deduction;
cout<<"netpayable salary is salary-deduction ="<<netpayable;
break;
default:
deduction=salary*(7/100);
netpayable = salary-deduction;
cout<<"netpayable salary is salary-deduction ="<<netpayable;
break;
}
system("pause");
}
einfaches Programm C++ Anweisung wechselt die Mitarbeitergehälter
i beschäftigt haben zu finden, und ich mag ein einfaches Programm machen, in dem ich switch-Anweisung bin mit dem Gehalt der verschiedenen Mitarbeiter abzuziehen die über 10.000 Rs so weiter ... aber der Compiler hat keinen Fehler gezeigt, aber das Programm läuft nicht und gibt eine Ausgabe wie im Bild gezeigt, ich bin etwas verwirrt darin.
die Warnmeldung Sie sehen werden sollten .. http://melpon.org/wandbox/permlink/mr5zv3DchszVMB3T – xaxxon
was netpayable ist = Lohn-Abzug; Was ist Lohnabzug? – shami
@shami, das muss "Gehalt" sein * minus * "Abzug" – CinCout