#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; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter