/*********************************** * Section : 15 * Machine No. : N * Roll No. : 19CS100XY * Name : Aritra Hazra * Assignment No : 0 * Description : first C program ************************************/ #include int main( ) { /* variable declarations */ int intVar = 2019; float floatVar = 2019.0802; int rank, marks, total; float percent; /* demo print statements */ printf("\n[1] Welcome to IITKGP %d!\n", intVar); printf("\n[2] 'Welcome' to \"IITKGP\" %o!\n", intVar); printf("\n[3] %% Welcome to IITKGP %x! %%\n", intVar); printf("\n[4] _/\\_ Welcome to IITKGP %X! _/\\_\n", intVar); printf("\n[5] Welcome\nto\nIITKGP\n%f!\n", floatVar); printf("\n[6] Welcome\tto\tIITKGP\t%.1f!\n", floatVar); printf("\n[7] Welcome\n\tto\n\t\tIITKGP\n\t\t\t%6.3f!\n", floatVar); printf("\n[8] Welcome to\ IITKGP\ %08i!\n\n", intVar); /* taking inputs from user */ printf("++ Enter Your IIT-JEE Rank (AIR): "); scanf("%d", &rank); printf("++ Enter Your Final Exam Marks: "); scanf("%d/%d", &marks, &total); /* showing user inputs */ printf("\n** Your IIT-JEE AIR = %010d", rank); printf("\n** Your Final Exam Percentage Marks = %3.2f%%\n", (marks*100.0/total)); return 0; }