Wednesday 9 March 2016

NEWSPAPER REPORT


In Japan ,there was a very huge Tsunami. Millions and millions worth buildings and properties were destroyed. Many people lost their lives. Most of them were injured and few were safe. A news reporter arrives to the spot to take the current survey regarding the situation of the people alive , dead and injured. He wanted to publish it in the newspaper and ask the other countries to help the affected people.

Can you please help him in this noble cause by writing a C program to generate the newspaper report?

INPUT FORMAT:

Input consists of three integers corresponding to the number of people dead , injured and those who are still alive and safe.

OUTPUT FORMAT:

Refer sample input and output for formatting specifications.

[All text in bold corresponds to input and the rest corresponds to output]

SAMPLE INPUT AND OUTPUT FORMAT:
 Enter the number of people dead:
 2000
 Enter the number of people injured:
 3000
 Enter the number of people safe:
 10000

 TSUNAMI REPORT OF JAPAN
 The number of people
 1)Dead:2000
 2)Injured:3000
 3)Safe:10000
 Please help the people who are suffering!!!

Code:
  #include<stdio.h>
int main(){
  int a,b,c;
  char d=')';
  printf("Enter the number of people dead:\n");
  scanf("%d",&a);
  printf("Enter the number of people injured:\n");
  scanf("%d",&b);
  printf("Enter the number of people safe:\n");
  scanf("%d",&c);
  printf("TSUNAMI REPORT OF JAPAN\n");
  printf("The number of people\n");
  printf("1%cDead:%d",d,a);
  printf("\n2%cInjured:%d",d,b);
  printf("\n3%cSafe:%d",d,c);
  printf("\nPlease help the people who are suffering!!!");
  
  return 0;
}

No comments:

Post a Comment