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 |
Explain the use of keyword 'register' with respect to variables.
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
write a program to create a sparse matrix using dynamic memory allocation.
What is sizeof return in c?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
What is #define used for in c?
what is array?
Why functions are used in c?
what is the flow of execution in cprogram? ex:printf();,scanf();
char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)
Is array a primitive data type in c?
What is #pragma statements?