Canna

Tuesday, 25 September 2018

Welcome to World

  • Problem Description

    Think that you are a scientist and you have invented a Humanoid Robot.You want to introduce your Robot in a SRM Aarush public meeting.You need to feed the information that the Robo thas to speak in the SRM Public Aarush public meeting.

    NOTE: The basic information includes the name of the Robo, creator, purpose of creation, Memory space of the Robo and its speed.

    Input and Output Format:

    Input consists of name (char array / string), creator (char array / string), purpose (char array / string), memory space (int), speed (float) and the output format is to display all the details in correct order. Refer sample input and output for further details.

    [All text in bold corresponds to input and the rest corresponds to output]
  • Test Case 1

    Input (stdin)
    eLab
    
    Care
    
    Programming
    
    4
    
    2.3
    
    
    Expected Output
    Robot Details
    
    I am the Robot named=eLab
    
    I was created by Care
    
    I am created for the purpose of Programming
    
    My memory space is around 4mb and my speed is 2.3TB
  • Test Case 2

    Input (stdin)
    eCurricula
    
    Care
    
    Learninginclass
    
    5
    
    3.3
    
    
    Expected Output
    Robot Details
    
    I am the Robot named=eCurricula
    
    I was created by Care
    
    I am created for the purpose of Learninginclass
    
    My memory space is around 5mb and my speed is 3.3TB
  • Program
  • #include <stdio.h>
    int main()
    {
      char a[50],b[50],c[50];
      int d;
      float e;
      scanf("%s%s%s%d%f",a,b,c,&d,&e);
      printf("Robot Details");
      printf("\nI am the Robot named=%s",a);
      printf("\nI was created by %s",b);
      printf("\nI am created for the purpose of %s",c);
      printf("\nMy memory space is around %dmb and my speed is %.1fTB",d,e);
     return 0;
    }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.