ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
pgm to find number of words starting with capital letters 
in a file(additional memory usage not allowed)(if a word 
starting with capital also next letter in word is capital 
cann't be counted twice)
 Question Submitted By :: Soumyajoy
I also faced this Question!!     Rank Answer Posted By  
 
  Re: pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
Answer
# 1
int flag=0,count=0;
FILE *in=fopen("in.txt","r");
while(!feof(in))
{
  if(  isupper( fgetc(in) ) && flag==0)
  {
        flag=1;
        count++;
  }
  else if( fgetc(in) ==' ')
        flag=0;
}
printf("Count=%d",count);

// PROGRAM VERIFIED WITH SAMPLE INPUT
 
Is This Answer Correct ?    2 Yes 2 No
Shiva
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what are two categories of clint-server application development ?  1
Why does not use getgh(); and <conio.h> in c language. Elofic1
What is alloca() and why is its use discouraged?  1
Write a C function to search a number in the given list of numbers. donot use printf and scanf Honeywell6
What is the real difference between arrays and pointers?  5
#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}  2
what is c? Tech-Mahindra4
f(char *p) { p=(char *)malloc(sizeof(6)); strcpy(p,"HELLO"); } main() { char *p="BYE"; f(p) printf("%s",p); } what is the output? Hughes6
What is the diffrent between while and do while statement ?  3
a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=? Geometric-Software5
void swap(int a,int b) { a=a+b; b=a-b; a=a-b; } in this code always gives the same result for all case TCS5
write a program to search for an element in a given array. If the array was found then display its position otherwise display appropriate message in c language  1
write a c programs to do multiplication of two numbers with out using arithmatic operator ?????????? TCS2
int *p=20; if u print like dis printf("%d",p); o\p:- 20; how is it possible? plz give me the explanation. Global-Edge5
what is the difference between arrays and linked list Tech-Mahindra7
What is macro? IBM3
what is the differnce between AF_INET and PF_INET? Wipro1
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); } ME2
Write a program to remove the C comments(/* */) and C++ comments(//) from a file. The file should be declared in command line. Subex1
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?  3
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com