0 Members and 1 Guest are viewing this topic.
#include <stdio.h>#include <stdlib.h>int main(int argc, char *argv[]){ int iAge; char szInput[128]; printf("Enter your age and press enter: "); gets(szInput); iAge = atoi(szInput); if (iAge < 13) { printf("You are a child because you are %d years old", iAge); } else if (iAge < 20) { printf("You are a teenager because you are %d years old", iAge); } else if (iAge < 66) { printf("You are an adult because you are %d years old", iAge); } else if (iAge < 136) { printf("You are an old fart because you are %d years old", iAge); } else { printf("Stop lying, idiot, you are not %d years old!", iAge); } return 0;}
Code: [Select]#include <stdio.h>#include <stdlib.h>int main(int argc, char *argv[]){ int iAge; char szInput[128]; printf("Enter your age and press enter: "); gets(szInput); iAge = atoi(szInput); if (iAge < 13) { printf("You are a child because you are %d years old", iAge); } else if (iAge < 20) { printf("You are a teenager because you are %d years old", iAge); } else if (iAge < 66) { printf("You are an adult because you are %d years old", iAge); } else if (iAge < 136) { printf("You are an old fart because you are %d years old", iAge); } else { printf("Stop lying, idiot, you are not %d years old!", iAge); } return 0;}
//--------------------------------//Converted to Visual basic 6//By [NwP] Gunner//Original code by mikechml//--------------------------------Private Sub Form_Load()Dim ageif age =< "13" thenmsgbox "You are a child because you are " & age & " years old."elseif age =< "20" thenmsgbox "You are a teenager because you are " & age & " years old."elseif age =< "66" thenmsgbox "You are an adult because you are " & age & " years old."elseif age =< "136" thenmsgbox "You are an old fart because you are " & age & " years old."elsemsgbox "Stop lying, idiot, you are not " & age & " years old!"end ifEnd Sub
SMF 2.0.19 | SMF © 2021, Simple Machines