Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <time.h>
- int main(){
- int nam;
- int hientai;
- time_t rawtime;
- struct tm timeinfo;
- time(&rawtime);
- localtime_s(&timeinfo, &rawtime);
- hientai = timeinfo.tm_year +1900;
- printf("\nNhap nam sinh: ");
- scanf_s("%d", &nam);
- int tuoi = hientai - nam;
- printf("\nBan sinh nam %d nen nam nay ban %d tuoi", hientai, tuoi);
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement