Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

string in c

#include<stdio.h>
void main(){
    int date;
    char fn[50], ln[50];
    printf("Enter your first name = ");
    scanf("%s",&fn);
    printf("Enter your last name = ");
    scanf("%s",&ln);
    printf("Enter your year of birth = ");
    scanf("%d",&date);
    printf("Your first name = %s
last name = %s
and year of birth = %d", fn, ln, date);
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #string
ADD COMMENT
Topic
Name
2+2 =