How to read strings including spaces through scanf( ) function in c programming language

preview_player
Показать описание
Find Here: Links of All C language Video's Playlists/Video Series
C Interview Questions & Answers | Video Series

for | while | do-while loops in c | Video Series

Functions in C | Video Series

Graphics in C | Video Series

1-D Array | 2-D Array | String | Pointer | Function | File Handling in C

Structure & Union in C | Video Series

String in C | Video Series

1-D Array in C | Video Series

2-Array in C | Video Series

C Preprocessor | Video Series

File Handling in C | Video Series

Pointer in C | Video Series

Dynamic Memory Allocation in C | Video Series

Pattern Programs in C | Video Series

Recursion in C | Video Series

#cprogramming #ctutorials #clanguage
Рекомендации по теме
Комментарии
Автор

Thanks for this clear explanation on the caret sign and what it is used for Sanjay - you are a very good teacher online - thanks for sharing your knowledge.

rajcodes
Автор

Why scanf takes one extra input if I leave space after %d? i.e.
for(i=0;i<5;i++)
scanf("%d "&a[i])
takes 6 inputs.

riyajuneja
Автор

sir esmai %s toh diya nhi hai toh sir ji usse kaise pta chal raha hai ki ye string hai

mukul_goyal
Автор

That identifier literally doesn’t work at all for me

MisterMissile
Автор

#include <stdio.h>
#include <conio.h>
void main ()
{
clrscr ();
int a, b;
char c;
printf ("Enter the values of a and b");
scanf ("%d%d", &a, &b);
printf ("Enter the operator");
scanf ("%c", &c);
switch (c)
{
case'+':
printf ("Result of addition is %d", a+b);
break;
case '-':
printf ("Result of subtraction, is %d", a-b);
break;
case'*':printf ("The result of Multiplication is %d", a*b);
break;
default :printf ("Invalid operator");
}
getch ();
}
program does not read value of c

dwaipayan
welcome to shbcf.ru