Skip to content

First Year Elab Level 3 (2021)

    Download the Brave browser for copying the code into your Elab click on the button to download the browser.

    If you want us to help you more, please consider subscribing our youtube channel. It would mean a lot to us and it will show us that you want us to help you more.

    Table of Contents

    Caleb is a physicist working for DASA (Domestic Aeronautics and Space Administration) centre.

    #include

    #include

    int main()

    {

        float gravity,distance,vf;

        scanf("%f",&distance);

        gravity=9.8;

        vf=sqrt(2*distance*gravity);

        printf("%.2f m/s",vf);

    return 0;}

    Shiva is part of the popular construction company in Tamilnadu.

    #include

    #include

    int main()

    {

        float base1,base2,height,area;

        scanf("%f %f %f",&base1,&base2,&height);

        area=height*(base1+base2)/2;

        printf("%.2f",area);

    return 0;

    }

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Ford once was going down by loosing all their share values due to the less innovative employees in their company.

    #include

    int main()

    {int seconds,days,hours,minutes;

        scanf("%d",&seconds);

        days=seconds/86400;

        seconds=seconds-86400*days;

        hours=seconds/3600;

        seconds=seconds-3600*hours;

        minutes=seconds/60;

        seconds=seconds-minutes*60;

        printf("The Duration is %d days %d hours %d minutes %d seconds",days,hours,minutes,seconds);

                   return 0;

    }

    Tina successfully completed her first Month as Navy Officer and her much awaited first month salary got credited into her account and also go her salary report in her mail.

    #include

    int main()

    {

        float basicPay,employeeFund,employerFund;

        scanf("%f",&basicPay);

        employeeFund=(basicPay/100)*17.5;

        employerFund=(basicPay/100)*23.5;

        printf("%.2f\n%.2f",employeeFund,employerFund);  return 0;}

    Krishna has just arrived in the city of Madhura.

    #include

    int main()

    {

        int m,n;

        float r;scanf("%d %d",&m,&n);

        r=(float)m*(float)n/2;

        printf("%.f",r);return 0;

    }

    Aarav and Nathan who live in the fictional town of Pune, think and do innovatively on weekends.

    #include

    int main()

    {

        float a,b;

        scanf("%f %f",&a,&b);

       ((int)a==(int)b)?(printf("Approximate number")):(printf("Not an Approximate number"));

                   return 0;

    }

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Sathya is an mathematical expert training youngsters struggling in maths to make them better.

    #include

    #include

    int main()

    {

        double base,exp,opt;

        scanf("%lf %lf",&base,&exp);

        opt=pow(base,exp);

        printf("%.2lf",opt);

                   return 0;}

    Zaheer and Vinod went to California for attending the Apple products launch event.

    #include

    #include

    int main()

    {

    float appleno;

    int x;

    scanf("%f",&appleno);

    x=(int)appleno;

    printf("%d",x%10);

                   return 0;

    }

    Madhan was working as a loco pilot in the Indian railways.

    #include

    #include

    int main()

    {

     float distance,meter,feet,inches,centimeter;

     scanf("%f",&distance);

     meter=distance*1000;

     feet=distance*3280.84;

     inches=distance*39370.1;

     centimeter=distance*100000;

     printf("%.2f m\n%.2f ft\n%.2f in\n%.2f cm",meter,feet,inches,centimeter);

                   return 0;}

    Binita always dreamed of flying in the sky from her childhood.Her goal was to become a pilot.

    #include

    #include

    int main()

    {

        float height,bmi;

        int weight;

        scanf("%d %f",&weight,&height);

        bmi=(float)weight/(float)pow(height,2);

        printf("%.2f",bmi);

                   return 0;}

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Simon loves to listen to music while walking his way to attend boring lectures in his college.

    #include

    int main()

    {

        int L,D;

        int t,n;

        scanf("%d %d",&L,&D);

        t=D/0.5;

        if (t%L==0)

        n=t/L;

        else

        n=1+t/L;

        printf("%d",n);

                   return 0;}

    Tina and Fazil are bored, so they are playing an infinite game of ping pong.

    #include

    int main()

    {

        int x,y,k;

        int total;

        scanf("%d %d %d",&x,&y,&k);

        total=x+y+k;

        if(total%2==0)

        { printf("Tina");} else {

            printf("Fazil"); }  return 0;}

    Simon was working in a Casa Grande.

    #include

    int main()

    {

        int side1,side2,side3;

        scanf("%d %d %d",&side1,&side2,&side3);

        if (side1==side2 && side1==side3)

        printf("Equilateral triangle");

        else if (side1==side2 || side1==side3 || side2==side3)

        printf("Isosceles triangle");

        else

        printf("Scalene triangle");

    return 0;

    }

    Pongal gifts are a tradition in which children receive money from elder relatives during the Pongal celebration.

    #include

    int main()

    {

        int a1,a2,a3,c1,c2,c3;

        scanf("%d %d %d %d %d %d",&a1,&a2,&a3,&c1,&c2,&c3);

        if ((a2>=a3 && a3>=a1 && c2>=c3 && c3>=c1)||(a3>=a1 && a2>=a1 && c3>=c1 && c2>=c1)||(a3>=a1 && a1>=a2 && c3>=c1 && c1>=c2))

        printf("FAIR");

        else if(a1==a3 && a1>=a2 && c1==c3 && c1>=c2)

        printf("NOT FAIR");

        else

        printf("NOT FAIR");

    return 0;}

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

     Nowadays many people from different under developed cities across India were coming to Tamil Nadu for Job opportunities and the owners of different businesses were employing child workers as well as aged people at low salaries which is actually the violation as per Employment act of Tamil Nadu Government.

    #include

    int main()

    {

    int workage;

    scanf("%d",&workage);

    if (workage<18)

    printf("You are Minor\nContinue Your Studies");

    else  if(workage>=18 && workage<=60)

    printf("You are Eligible\nYou can Apply for Job");

    else

    printf("You are too Old\nPls Collect your Pension");

                   return 0;

    }

    Yasir is the chiel in-charge for data collection from candidates applied for M.Tech Programme in his university As a part of data collection university have requested the candidates to mention their Gender (Male or Female)

    #include

    int main()

    {

        char gen;

        scanf("%c",&gen);

        switch(gen)

       {  case 'm':

            printf ("Male");break;

            case'M':

            printf("Male");break;

            case'f':

            printf("Female");break;

            case 'F':

            printf("Female");break;

            default:

            printf("Unspecified Gender");

    }

                   return 0;

    }

    Lee is ill. He goes to Karky the Siddha Doctor.

    #include

    #include

    int main()

    {

        int lengthofbook,numofpages; scanf("%d %d",&lengthofbook,&numofpages);

        if (lengthofbook<=23 && 500<=numofpages && numofpages<=1000)

        printf("Take Medicine");

        else

        printf("Don't take Medicine");

                   return 0;

    }

    Central library needs your help! Given the expected and actual return dates for a library book, create a program that calculates the fine (if any).

    #include

    int main()

    {  int d1,d2,m1,m2,y1,y2;

        int f;

        scanf("%d %d %d\n",&d2,&m2,&y2);

        scanf("%d %d %d",&d1,&m1,&y1);

        if (d1==d2 && m1==m2 && y1==y2)

        printf("0");

        else if(m1==m2)

        f=15*(d2-d1);

        else if(y1==y2)

        f=500*(m2-m1);  else if (y1!=0)    f=10000;    printf("%d",f);          return 0;}

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Today is Darsh’s birthday but I forgot to bring a gift for him.

    #include

    int main()

    {

    int favorite_number,first_number,difference;

    scanf("%d %d %d",&first_number,&favorite_number,&difference);

    if ((favorite_number-first_number)*difference>0 && (favorite_number-first_number)%difference==0 )

    printf("YES");

    else

    printf("NO");

    return 0;

    }

    Nathan has the following two types of taxis:

    #include

    int main()

    { int D,Oc,Of,Od,Fs,Fb,Fm,Fd;

        scanf("%d\n %d %d %d\n %d %d %d %d",&D,&Oc,&Of,&Od,&Fs,&Fb,&Fm,&Fd);

       float time,c,c1;

        time=(float)D/Fs;

        c=(Oc)+Od*(D-Of);

        c1=Fb+Fm*time+Fd*D;

        if(c1>c)

        printf("OLA Taxi");

        else if(c1>=c)

        printf("OLA Taxi");    else  printf("Fastrack Taxi");  return 0;}

    There are K nuclear reactor chambers labelled from 0 to K-1.

    #include

    int main()

    {

    int a,n,k,i,b;

    scanf("%d%d%d",&a,&n,&k);

    for(i=0;i<k;i++){

        b=a%(n+1);

        printf(" %d",b);

        a=a/(n+1);

    }

    while(a>0){}

                   return 0;

    }

    You are at a party of N people, where only one person is known to everyone.

    #include

    #include

    int main()

    {

    int t;

    scanf("%d",&t);

    while(t–)

    {int n,guest=0,req=0,i,j;

    bool got=0;

    scanf("%d",&n);

    int a[1000][1000];

    for(i=0;i<n;i++)

    {for(j=0;j<n;j++)

    {scanf("%d",&a[i][j]);}}

    for(i=0;i<n;i++)

    {int count=0;

    for(j=0;j<n;j++)

    {if(a[i][j]==1)

    {count++;}}

    if(count==0)

    {guest++;}

    if(guest==1 && !got)

    {got=1;

    req=i+1;}}

    if(guest!=1)

    {printf("-1\n");}

    else

    {printf("%d\n",req);}}

    return 0;}

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Raju is a Tester in the popular MNC Company.

    #include

    #include

    int main()

    {

    char para[100000];

    int t,n,i,task=0;

    scanf("%d",&t);

    while(t>0){

    scanf("%s",para);

    n= strlen(para);

    for(i = 0; i < n/2; i++){

    if(n%2 !=0){

    printf("Not Balanced\n");

    task=1;

    break;

    }

    if(para[i]=='{' && para[n-i-1]=='}'){

    task=0;

    }

    else if(para[i] == '(' && para[n-i-1]== ')'){

    task=0;

    }

    else if(para[i]=='[' && para[n-i-1]== ']'){

    task=0;

    }

    else{

    printf("Not Balanced\n");

    task=1;

    break;

    }

    }

    if(task==0){

    printf("Balanced\n");

    }

    task=0;

    t–;

    }

    return 0;

    }

    Irfan has a sequence of N integers, A1,A2,…,AN.

    #include

    int main()

    {int t;

    scanf("%d", &t);

    while(t–){

    int no[100],fs[100];

    int n,m,i,j;

    scanf("%d", &n);

    for(i = 0; i < n; i++){

    scanf("%d", &no[i]);

    }

    scanf("%d", &m);

    for(i = 0; i < m; i++){

    scanf("%d", &fs[i]);

    }

    int count = 0;

    for(i = 0; i < m; i++){

    for(j = 0; j < n ; j++){

    if(fs[i] == no[j])

    count++;}}

    if(count == m)

    printf("Yes\n");

    else printf("No\n");}return 0;}

    Karthik asks Jessi for a date.

    #include

    int main()

    {int t,s=0,n,bug,i; scanf("%d",&t);

    while(t–){

    scanf("%d %d",&n, &bug);

    int a[n];

    for(i=0;i<n;i++){ scanf("%d",&a[i]);

    s+=a[i];

    }

    if(s>bug){ printf("YES\n");

    } else{

    printf("NO\n");}

    s=0;}return 0;}

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Confused? Well it stands for Welcome To Indian Railways Catering and Tourism Corporation

    #include

    #include

    #include

    int main()

    {int k,n,i,j,count,l=0;

    char str1[101][101],str2[101][101];

    char ch[100];

    scanf("%d",&k);

    for(i=0;i<k;i++)

    scanf("%s",str1[i]);

    scanf("%d",&n);

    i=0;

    while(i++!=n)

    {scanf("%s",str2[i]);

    for(j=0;j<k;j++)

    if(!strcmp(str2[i],str1[j]))

    count++;

    if(!count)

    ch[l++]=(toupper(str2[i][0]));

    count=0;

    }

    for(i=0;i<l;i++)

    if(i!=(l-1))

    printf("%c.",ch[i]); else    printf("%c",ch[i]); return 0;}

    Neo and Morpheus are stuck in matrix.

    #include

    #include

    int main()

    {char direction[1000000];

    int x=0,y=0,i;

    scanf("%s",direction);

    for(i=0;i<strlen(direction);i++)

    {if(direction[i]=='L')

    x–;

    else if(direction[i]=='R')

    x++;

    else if(direction[i]=='U')

    y++;

    else if(direction[i]=='D')

    y–;

    }

    printf("%d %d",x,y);

                   return 0;

    }

    Krishna has just arrived in the city of Madhura

    #include

    #include

    int main()

    {int m,n;

        float f;

        scanf("%d%d",&n,&m);f=(float)(m*n)/2;

        printf("%.0f",ceil(f));

        return 0;}

    AndMozhivarman and his wife Yazhini loves to travel around the world.

    #include

    int main()

    {int mpg;

        float lph;

        scanf("%d",&mpg);

        lph=235.215/mpg;

        printf("%.2f L/100 km",lph);

        return 0;

    }

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Simon owned a welding company He bought different types of metal for making different products

    #include

    int main()

    {

        float celsius,fahrenheit;

        scanf("%f",&celsius);

        fahrenheit=(celsius*1.8)+32;

        printf("%.2f fahrenheit",fahrenheit);

                   return 0;

    }

    Ford once was going down by loosing all their share values due to the less innovative employees in their company.

    #include

    int main()

    {int seconds,days,hours,minutes;

    int a,b;

    scanf("%d",&seconds);

    days=seconds/86400;

    a=seconds%(24*3600);

    hours=a/3600;

    b=a%3600;

    minutes=b/60;

    printf("The Duration is %d days %d hours %d minutes %d seconds",days,hours,minutes,a%60);

    return 0;

    }

    Binita always dreamed of flying in the sky from her childhood Her gool was to become a pilot

    #include

    int main()

    {

        float height,bmi;

        int weight;

        scanf("%d%f",&weight,&height);

        height=height*height;

        bmi=weight/height;

        printf("%.2f",bmi);

                   return 0;

    }

    Zaheer and Vinod went to California for attending the Apple products launch event

    #include

    int main()

    {

        float appleno;

        int ip,rmd;

        scanf("%f",&appleno);

        ip=appleno;

        rmd=ip%10;

        printf("%d",rmd);

                   return 0;

    }

    Darsh is basically a watch mechanic

    #include

    int main()

    {

        int days,hours,minutes,seconds,total_days_seconds,total_min_hours,total_minutes_seconds,total;

        scanf("%d%d%d%d",&days,&hours,&minutes,&seconds);

        total_days_seconds=days*86400;

        total_min_hours=hours*3600;

        total_minutes_seconds=minutes*60;

        total=total_days_seconds+total_minutes_seconds+total_min_hours+seconds;

        printf("%d seconds",total);

                   return 0;

    }

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Tino successfully completed her first Month as Navy Officer and her much awaited first month salary got credited into her account and also go her salary report in her mail.

    #include

    int main()

    {

        float basicPay,employeeFund,employerFund;

        scanf("%f",&basicPay);

        employeeFund=0.175*basicPay;

        employerFund=0.235*basicPay;

        printf("%.2f\n",employeeFund);

        printf("%.2f\n",employerFund);

                   return 0;

    }

    Yasir was making a kite

    #include

    #include

    int main()

    {

        float s1,s2,s3,s,area;

        scanf("%f%f%f",&s1,&s2,&s3);

        s=(s1+s2+s3)/2;

        area=sqrt(s*(s-s1)*(s-s2)*(s-s3));

        printf("%.2f",area);

                   return 0;

    }

    Central library needs your help!

    #include

    int main()

    {

        int d1,d2,m1,m2,y1,y2;

        scanf("%d %d %d",&d1,&m1,&y1);

        scanf("%d %d %d",&d2,&m2,&y2);

        if(y1>y2)

            printf("10000");

        else if(y1==y2){

            if(m1>m2)

            printf("%d",500*(m1-m2));

            else if(m1==m2){

                if(d1>d2)

                printf("%d",15*(d1-d2));

                else{

                printf("0");

                }

            }

            else{

                printf("0");

            }

        }

        else{

            printf("0");

        }

        return 0;}

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Salima was working in one of the famous MNC

    #include

    #include

    int main()

    {

        float a,b,c;

        float root1,root2,imaginary,discriminant;

        scanf("%f %f %f",&a,&b,&c);

        discriminant=(b*b)-(4*a*c);

        switch(discriminant>0){

            case 1:

                root1=(-b+sqrt(discriminant))/(2*a);

                root2=(-b-sqrt(discriminant))/(2*a);

                printf("%.2f and %.2f",root1,root2);

                break;

            case 0:

                switch(discriminant<0)

                {

                case 1:

                    root1=root2=-b/(2*a);

                    imaginary=sqrt(-discriminant)/(2*a);

                    printf("%.2f + i%.2f and %.2f – i%.2f",root1,imaginary,root2,imaginary);

                    break;

                case 0:

                    root1=root2=-b/(2*a);

                    printf("%.2f and %.2f",root1,root2);

                    break;

                }

        }

                   return 0;

    }

    Yasir has N Dairy Milks.

    #include

    int main()

    {int n;

        scanf("%d",&n);

        if(n%3==0){

            printf("YES");}

        else{

            printf("NO");}

    return 0;

    }

    Nancy is an graduate who lives in a small village.

    #include

    int main()

    {

        int travelmode;

        scanf("%d",&travelmode);

        switch(travelmode){

            case 1:

                printf("Car is booked");

                break;

            case 2:

                printf("Bus is booked");

                break;

            case 3:

                printf("Flight is booked");

                break;

            default :

                printf("Invalid Request");

        }

                   return 0;

    }

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Tina and Fazil are bored,

    #include

    int main()

    {int x,y,k;

        int total;

        scanf("%d %d %d",&x,&y,&k);

        total=x+y+k;

        if(total%2==0){

            printf("Tina");}

        else{

            printf("Fazil");}

    return 0;

    }

    Arulmozhivarman the famous skill trainer planned to conduct a quiz program for his followers in Facebook

    #include

    int main()

    {char operator;

        double n1, n2;

        scanf("%c %lf %lf",&operator,&n1,&n2);

        switch(operator){

            case '+':

                printf("%.1f",n1+n2);

                break;

            case '-':

                printf("%.1f",n1-n2);

                break;

            case '*':

                printf("%.1f",n1*n2);

                break;

            case '/':

                printf("%.1f",n1/n2);

                break;

            default :

                printf("Invalid");}

    return 0;

    }

    Simon, Nancy, and Yasir are good friends and set up an iconic company after graduation

    #include

    int main()

    {

        char alphabet;

        scanf("%c",&alphabet);

        switch(alphabet){

            case 'A':

            case 'E':

            case 'I':

            case 'O':

            case 'U':

            case 'a':

            case 'e':

            case 'i':

            case 'o':

            case 'u':

                printf("Vowel");

                break;

            default :

                printf("Consonant");

                break;}

    return 0;

    }

    TAP on the Image to avail offers

    USE CODE: AWAX2021, Limited time offer

    Nathan was so fashion sensitive from his childhood Nathan usually likes to wear different coloured shirts for different days (All 7 days in a week)

    #include

    int main()

    {

        int days;

        scanf("%d",&days);

        switch(days){

            case 1:

                printf("Azure");

                break;

            case 2:

                printf("Beige");

                break;

            case 3:

                printf("Brick Red");

                break;

            case 4:

                printf("Champagne");

                break;

            case 5:

                printf("Desert Sand");

                break;

            case 6:

                printf("Ivory");

                break;

            case 7:

                printf("Pear");

                break;

            default :

                printf("Invalid Day");}

    return 0;

    }

    Nowadays many people from different under developed cities across India were coming to Tamil Nadu

    #include

    int main()

    {

        int workage;

        scanf("%d",&workage);

        if(workage<18){

            printf("You are Minor\n");

            printf("Continue Your Studies");

        }

        else if(workage>=18 && workage<=60){

            printf("You are Eligible\n");

            printf("You can Apply for Job");

        }

        else{

            printf("You are too Old\n");

            printf("Pls Collect your Pension");

        }

                   return 0;

    }

    Nathan has the following two types of tax

    #include

    int main()

    {

        int D,Oc,Of,Od,Fs,Fb,Fm,Fd;

        scanf("%d\n %d %d %d\n %d %d %d %d",&D,&Oc,&Of,&Od,&Fs,&Fb,&Fm,&Fd);

        float time,c,c1;

        time=(float)D/Fs;

        c=(Oc)+Od*(D-Of);

        c1=Fb+Fm*time+Fd*D;

        if(c1>=c)

        printf("OLA Taxi");

        else if(c1>=c)

        printf("OLA Taxi");

        else

        printf("Fastrack Taxi");

                   return 0;

    }

    Leave a Reply

    Back to Top