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 |
control 50 devices which has 2 states on and off.using bitwise operator.plz answer it its urgent
Explain the difference between getch() and getche() in c?
which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..}
What is volatile keyword in c?
I have an array of 100 elements, each of which is a random integer. I want to know which of the elements: a) are multiples of 2 b) are multiples of 2 AND 5 c) have a remainder of 3 when divided by 7
The difference between printf and fprintf is ?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
How does normalization of huge pointer works?
what is ur strangth & weekness
0 Answers Cognizant, LG Soft, NetEnrich,
What is #include conio h?
What is the relationship between pointers and data structure?
What is a scope resolution operator in c?