Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * test.c
- *
- * Created on: Dec 10, 2019
- * Author: student
- */
- // 1770103222698
- // 5010124226729
- #include<stdio.h>
- int main(){
- char cnp[14];
- int AnulNasterii;
- int Varsta;
- int anCurent;
- int zeci;
- int unitati;
- int cnp1, cnp2;
- int numar;
- printf("Introduceti CNP-ul dumneavoastra: ");
- scanf("%s", cnp);
- printf("Introduceti anul curent:");
- scanf("%d", &anCurent);
- numar = cnp[0] - '0';
- zeci = cnp[1] - '0';
- unitati = cnp[2] - '0';
- AnulNasterii = 1900 + (numar * 100)+ zeci * 10 + unitati;
- Varsta = anCurent - AnulNasterii;
- printf("varsta = %d\n", Varsta);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement