ADVERTISEMENT

One of the works done by our Robotics and Machine Learning division,
SELF-LEVELING QUADCOPTER
Arduino based Quadcopter.
Self-leveling is acheived by the aligning the quadcopter using the readings from the gryo as well as the accelerometer.
A four channel RC transmitter is used to control the movement of the quadcopter when in flight. Kindly subscribe to our YouTube Channel and stay tuned.

Wednesday 10 August 2016

CSE1002:PP2:PLURAL

#include<stdio.h>
#include<string.h>
#include<ctype.h>
void main()
{
    int i;
    char str[20],str1[25];
    scanf("%s",str);
    //printf("%s",str);
    int c=0;
    if(str[strlen(str)-1]=='y')c=1;
    for(i=0;i<strlen(str)-c;i++)
    {
        str[i]=tolower(str[i]);
        str1[i]=tolower(str[i]);
    }
    if(c==1)
    {strcat(str1,"ies");}
    else if(str[strlen(str)-1]=='s' ||(str[strlen(str)-1]=='c' ||str[strlen(str)-1]=='h' )||(str[strlen(str)-1]=='s' ||str[strlen(str)-1]=='h' ))
    {
        strcat(str1,"es");
    }
    else
    strcat(str1,"s");
   
    printf("%s",str);
    printf(" %s",str1);
}

No comments:

Post a Comment