Practical 3 Code Sample UTAR Programming Concepts
Practical 3 Code Sample UTAR Programming Concepts
#include <stdio.h>
int main()
{
int age;
return 0;
}
-----------------------------------------------------------------------------------
--------------------------
//Practical_3_Q2
#include <stdio.h>
int main()
{
int req_mark, top_half;
float ACT, CGPA;
req_mark = 0;
if (req_mark >= 2)
printf("\nELIGIBLE for sports \n");
else
printf("\nNOT ELIGIBLE for sports \n");
return 0;
}
-----------------------------------------------------------------------------------
-------------------------
//Practical_3_Q3
#include <stdio.h>
int main()
{
int int1, int2, sum, sub, mul;
float div;
if (int2 == 0)
printf("Quotient = Math error \n");
else
{
div = (float)int1 / int2;
printf("The quotient is %.2f \n\n", div);
}
return 0;
}
-----------------------------------------------------------------------------------
-------------------------
//Practical_3_Q4
#include <stdio.h>
int main()
{
char employee_no[10];
float retail_price, commission;
char transaction_code, S, M, L;
return 0;
}
-----------------------------------------------------------------------------------
-------------------------
//Practical_3_Q5_V1
#include <stdio.h>
int main()
{
int paper_no, pack_no;
return 0;
}
-----------------------------------------------------------------------------------
-------------------------