accept character from keyboard untill the user presses the
enter key.If the user enters any character other than upper
case(A-Z)alphabets program should stop taking any input



accept character from keyboard untill the user presses the enter key.If the user enters any charac..

Answer / shrikantauti

use if condition
if(ch>=65 &&ch<=90)
{
scanf("%c",&ch);
}
else
{
break;
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

what is the defrenece between structure and union

5 Answers   Aloha Technology,


What is Conio.h ?

2 Answers   TCS,


main() { int a,b; printf("%d,%d",scanf("%d%d",&a,&b)); } => do u mean above program's output... =>output will be:2,whatever you enter value for b. =>because scanf is a library fn which will return how many arguements it processes, and second value you are right mr.Satya but i found my self unable to understand that for the first time scanf returns the no of successful matches but how for the second time it returns the value of 'b'.while a function should return the same 'r' value every time.

1 Answers   Cisco,


1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=

16 Answers   CybOrg, Siemens,


What is the purpose of macro in C language?

0 Answers   Fidelity,






What is a program?

0 Answers  


How do I access command-line arguments?

2 Answers   Bosch, Wipro,


What is d scanf?

0 Answers  


What is "Hungarian Notation"?

0 Answers   Celstream,


An entire structure variable can be assigned to another structure variable if __________

3 Answers   Sasken, TCS, Tech Mahindra, Wipro,


What is the explanation for cyclic nature of data types in c?

0 Answers  


what are # pragma staments?

0 Answers  


Categories