3. ROBOT

Image result for c programming
Code:
  #include<stdio.h>
#include<string.h>
int main(){
  char name[100], creator[150], purpose[150];
  int mspace;
  float speed;
  printf("Enter the Name :\n");
  scanf("%s",name);
  printf("Enter the Creator Name :\n");
  scanf("%s",creator);
  printf("Enter the Purpose :\n");
  scanf("%s",purpose);
  printf("Memory Space :\n");
  scanf("%d",&mspace);
  printf("Speed :\n");
  scanf("%f",&speed);
  printf("My Details :\n");
  printf("I am the Robot named %s.",name);
  printf("\nI was created by %s.",creator);
  printf("\nI am created for the purpose of %s.",purpose);
  printf("\nMy memory space is around %dGb and my speed is %.1fTb.",mspace,speed);
  return 0;
}

No comments