can anyone help me doing my simple assignment,please.
I feel fed up and got confused so far
myheart
0
Newbie Poster
Recommended Answers
Jump to PostPlease post the code you have so far and the questions...
Jump to PostThe question is to ask the user to enter a string which might be a number,symbol,letter or mix of these.The string must be of 12 characters long and message should be dispayed to the user as follow:
If he enters less than 3 characters a message is'your string is too …
Jump to PostRight away I would use the fgets function to get the string from the user and I would define your string as:
#include <stdio.h> #include <stdlib.h> int main(int argc, char**argv) { char ch[30]; fputs("enter some characters->", stdout); fgets(ch, 29, stdin); fprintf(stdout, "string->%s\n", ch); exit(EXIT_SUCCESS); }
This hint …
All 11 Replies
gerard4143
371
Nearly a Posting Maven
myheart
0
Newbie Poster
gerard4143
371
Nearly a Posting Maven
myheart
0
Newbie Poster
gerard4143
371
Nearly a Posting Maven
gerard4143
371
Nearly a Posting Maven
Seten
-1
Junior Poster
Seten
-1
Junior Poster
sush27
0
Newbie Poster
sush27
0
Newbie Poster
Seten
-1
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.