Write a statement using the sscanf operation to extract the

Write a statement using the sscanf() operation to extract the year, month and day from the string date. char date [50] = \"February 26, 2013\"; int year; char month[10]; int day;

Solution

Below is the code to extract year month and day from string date:- #include #include #include int main() { int day, year; char month[20], dtm[100]; strcpy( dtm, \"February 26 2013\" ); sscanf( dtm, \"%s %d %d\", month, &day, &year ); printf(\"%s %d, %d \ \", month, day, year); return(0); }
 Write a statement using the sscanf() operation to extract the year, month and day from the string date. char date [50] = \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site