C Coding
5_6222125641475556333.pdf
C practice questions, only for Beginners...Happy Coding :D
5_6242193455259321326.pdf
491.8 KB
I am sharing '5_6242193455259321326' with you
100. C program to generate the above pattern.
#include <stdio.h>
int main() {
int i,j,f,k;
char str[80];
printf("Enter a string: ");
scanf("%s",str);
for(i=0;str[i]!='\0';i++){
for(j=0;j<=i;j++){
printf("%c",str[j]);
}
printf("\n");
}
for(k=i-1;k > 0; k--){
for(j=0;j<k;j++){
printf("%c",str[j]);
}
printf("\n");
}
return 0;
}
#include <stdio.h>
int main() {
int i,j,f,k;
char str[80];
printf("Enter a string: ");
scanf("%s",str);
for(i=0;str[i]!='\0';i++){
for(j=0;j<=i;j++){
printf("%c",str[j]);
}
printf("\n");
}
for(k=i-1;k > 0; k--){
for(j=0;j<k;j++){
printf("%c",str[j]);
}
printf("\n");
}
return 0;
}
Hello everyone, I hope we all are doing good. I apologize for not being active these days. I'll start uploading new programs as soon as possible. Thanks for your patience.
Happy Coding!
Happy Coding!
👍6