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  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
I have an array of 100 elements. Each element contains some 
text. i want to: 
append a star character to the end of every fifth element 
remove every second character from every tenth element, 
and… 
add a line feed (ascii 10) after the 30th character of 
every array element whose length is greater than 30 
characters.
 Question Submitted By :: Santosh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: I have an array of 100 elements. Each element contains some text. i want to: append a star character to the end of every fifth element remove every second character from every tenth element, and… add a line feed (ascii 10) after the 30th character of every array element whose length is greater than 30 characters.
Answer
# 1
int process_str()
{
	int i, j;
	char  *ptr[100] = {"some text here"};	
	int len = 100;

	for(i = 0; i < len; i++)
	{
		if(!(i % 5))
		{
			// process fifth element
		}
		elseif(!(i % 10))
		{
			// process 10th element
		}
		elseif(!(i % 30))
		{
			// process 30th element
		}
	}
}
 
Is This Answer Correct ?    0 Yes 0 No
Ravi Joshi
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What are the phases in s/w developed life cycle? wat is the diff b/w stack & queue...where do we use stack  5
How do I declare a pointer to an array?  5
pgm to reverse string using arrays i.e god is love becomes love is god) (assumption:only space is used for seperation of words) no addtional memory used.i.e no temporary arrays can used. Persistent4
char ch="{'H','I',0};printf("%s",ch);what is output Accenture9
What are volatile variables?  1
What does the message "warning: macro replacement within a string literal" mean?  1
What is macro? IBM4
What is the relation between # and include<stdio.h> HCL3
What compilation do? Geometric-Software7
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  3
without a terminator how can we print a message in a printf () function. NIIT5
Is main() function predfined or userdefined?  7
What is meant by int fun const(int a, int b) { .... ... }  1
I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.  1
Struct(s) { int a; long b; } Union (u) {int a; long b; } Print sizeof(s)and sizeof(u) if sizeof(int)=4 and sizeof(long)=4 Mascot2
what is meant by the "equivalence of pointers and arrays" in C? Satyam3
Write a program to accept a character & display its corrosponding ASCII value & vice versa?  4
totally how much header files r in c language TCS4
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h" Accenture14
what are two categories of clint-server application development ?  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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