Advertisement
mosaid

Untitled

Oct 25th, 2020
2,051
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h> // for strcat,cpy...
  3. #include<stdlib.h> // for atof
  4.  
  5. void show(int id, char* FullName, float M){
  6.     printf("Your Name is %s", FullName);
  7.     printf(" and your ID is %d \n",id);
  8.     printf(" and your mark is %f \n",M);
  9. }
  10.  
  11. int main(){
  12.     char FirstName[20];
  13.     char LastName[20];
  14.     char FullName[40];
  15.     unsigned char Mark[5];
  16.     int ID;
  17.  
  18.     printf("Please Enter Your ID: ");
  19.     scanf("%d", &ID);
  20.     printf("please enter your first name: ");
  21.     scanf("%s", FirstName);
  22.     printf("Please enter your last name: ");
  23.     scanf("%s", LastName);
  24.  
  25.     strcpy(FullName,FirstName);
  26.     strcat(FullName," ");
  27.     strcat(FullName,LastName);
  28.  
  29.     strcpy(Mark,"85.5");
  30.     float M = atof(Mark);
  31.  
  32.     show(ID,FullName,M);
  33.  
  34.     return 0;
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement