Dhaka International University: TH ND
Dhaka International University: TH ND
#include<stdio.h>
int main()
{
int a=100;
if(a>10)
{ printf("Bangladesh"); }
else if(a>20)
{ printf("Australia"); }
else if(a>30)
{ printf("Newzealand"); }
return 0;
}
3. What are the differences between int, double and float variables. Give explanations. 5
GROUP B
Answer any One Question out of Two 5×1=5
#include <studio.h>
int main()
int number1, number2
printf("Enter two integers: ");
scanf("%d d", &number1, number2);
if(number1 == number2){
printf("%d %d",&number1,number2);
}
else if (number1 > number2){
print("%d", number1, number2);
}
else {
printf(" d %d",number1, &number2);
}
return 0;
}
5. State the differences between switch-case and if-else in c programing. Give examples. 5
GROUP C
This part is compulsory and no alternative here 5×1=5
6. Suppose you are a billionaire and you have 3 luxury cars, Ferrari, Mercedes and Bmw. 5
Every day you go to your office to look after your business but your office is not near
your home and you need to refuel your car from a patrol pump. You use your cars
depends on the amount of petrol you can get from that pump. Now there can be 4
conditions which are given below.
1. You ride in Ferrari if the pump has more than 100 litre of patrol
2. You ride in Mercedes if the pump has less than 50 litre of patrol
3. You use Bmw if you have more than 50 litre but less than 100 litre of patrol.
4. Otherwise You walk for your office