How to receive strings with spaces in scanf()
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
char a[50];
printf("enter the string :");
for(int i=0;1;i++)
{
scanf("%c",&a[i]);
if(a[i]=='\n')
a[i]='\0'
break;
}
for(i=0;a[i]!='\0;i++)
printf("%c",a[i]);
getch();
}
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / suman halder
#include<stdio.h>
int main()
{
char str[100];
scanf("%[^\n]s",str);
}
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / murugannr
#include<studio.>
#include<coino.>
viod main
{
int a,b:
char a[12];
char b[10];
Printf{"enter the using string a,b");
scanf("%s,%a,%b");
get(ab)
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / parmjeet kumar
#include<stdio.h>
#include<conio.h>
void main()
{
char a[50];
printf("enter the string:");
scanf("%s",&a);
printf("%s",a);
getch();
}
Is This Answer Correct ? | 0 Yes | 10 No |
What is the size of enum in bytes?
How can a program be made to print the line number where an error occurs?
What is line in c preprocessor?
what is c language.
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output
What is volatile keyword in c?
what do you mean by enumeration constant?
You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less.
write a c program to change only the 3rd bit of the particular number such that other bits are not affected.. if bitnum=10(say.. it can be any no..
What are the 4 types of organizational structures?
will the program compile? int i; scanf(ā%dā,i); printf(ā%dā,i);
m=++i&&++j(||)k++ printf("%d"i,j,k,m)