myCompiler myCompiler
Deutsch English Español Français Italiano 日本語 한국어 Nederlands Polski Português
Recent
Login Sign up
Recent
Login Sign up
S

@shahzebshaikh78

finding length of string

C
2 years ago
#include <stdio.h> int main() { char para[50]; fgets(para,50,stdin); int count=0; for (int i=0; para[i] != '\0'; i++) { count++; } printf("You typed %d characters", count);

gets fgets and puts

C
2 years ago
#include <stdio.h> int main() { char fullName[50]; //gets(fullName); //this is dangerous and outdated fgets(fullName,50,stdin); puts(fullName); }

printing string with %s

C
2 years ago
#include <stdio.h> int main() { char name[30]; printf("Enter Your Name: \n"); scanf("%s", name); printf("%s", name); }

printing string

C
2 years ago
#include <stdio.h> void printString(char []); int main() { char firstName[] = "Shahzeb Ahmed "; char lastName[] = "Shaikh"; printString(firstName); printString(lastName); }

character array

C
2 years ago
#include <stdio.h> int main() { char name[]={'S', 'h', 'a', 'h', 'z', 'e', 'b'}; for (int i=0; i<7; i++) { printf("%c", name[i]); } }
Previous Next page

Supported languages

Deno JavaScript NodeJS Python Ruby Go C C++ Java C# TypeScript PHP Bash R Octave (MATLAB) Fortran Lua Erlang SQL MySQL MongoDB Clojure D Perl Kotlin Swift Rust Assembly
© 2026 mycompiler.io
Terms of service Privacy policy Contact us