Commit cd5a562d authored by Zhaozhong Liu's avatar Zhaozhong Liu
Browse files

Pre-lab 1.1 completed

parent 13de919b
File added
File added
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
char ch;
int i;
float fl;
char *str;
if (argc != 5){
printf("Invalid number of arguments.\n");
}else{
ch = argv[1][0];
i = atoi(argv[2]);
fl = atof(argv[3]);
str = argv[4];
//printf("%c %d %f %s", ch,i,fl,str);
}
}
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
char ch;
int i;
float fl;
char str[100];
printf("please give me the input");
scanf("%c %d %f %str\n", &ch,&i,&fl,&str);
if (argc != 5){
printf("Invalid number of arguments %d\n", argc);
}else{
printf("%c", ch);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment