switch que 1

PHOTO EMBED

Tue Nov 30 2021 13:38:49 GMT+0000 (Coordinated Universal Time)

Saved by @codewitharchi

#include<stdio.h>
int main()
{
	int a,b;
	printf("Type 1 for kg to gm convo and the value\n");
	printf("Type 2 for m to cm convo and the value\n");
	printf("Type 3 for min to sec convo and the value\n");
	printf("Type 0 for exit\n");
	scanf("%d",&a);
	scanf("%d",&b);
	
    switch(a)   
	{
	case 1:
		printf("%d kg in gm = %d",b,1000*b);
		break;
	case 2:
		printf("%d m in cm = %d",b,100*b);
		break;
	case 3:
		printf("%d min in sec = %d",b,60*b);
	    break;
	case 0:
		printf("You choose to exit");
		break;
    default:
		printf("Invalid data");
	}
    	return 0;
}
content_copyCOPY