Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:26:34+00:00 2026-05-25T19:26:34+00:00

I was coding a program to find the longest common sub-sequence today and I

  • 0

I was coding a program to find the longest common sub-sequence today and I was getting the elements of the each sequence into a character array. but I ran into a little problem. I used a for loop to get the elements but not matter how high I set the number of iterations the loop should execute it always terminated after 5 iterations. The array into which the data was being input was an array of size 10 so there were no issues with the array size. I coded a small test program to check and even in the test program the for loops that get data for a character array always terminate after 5 iterations . Why ?( I am forced to use turbo c++ in my lab)

#include<stdio.h>
void main()
{
     int i;
     char s[10];
     for(i=0;i<10;i++)
     scanf("%c",&a[i]);
 }

The above code was the test program.for loop terminated after 5 iterations here too !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:26:34+00:00Added an answer on May 25, 2026 at 7:26 pm

    Newline characters ('\n') are characters too. If you type H, <return>, e, <return>, l, <return>, l, <return>, o, <return>, they you’ve entered 10 characters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am coding a feature in a program where users can edit documents stored
What is the correct way for a 32-bit application to find the Program Files
I am not a program designer by any means but I would really like
I'm going through the full tutorial at cplusplus.com, coding and compiling each example manually.
I've not done much coding for Windows lately, and I find myself sitting at
When coding web services, how do you structure your return values? How do you
In coding a traditional MVC application, what is the best practice for coding server-side
When coding, what in your experience is a better approach? Break the problem down
The coding is done using VS2008 There are two divs in my page namely
When coding, what is a good rule of thumb to keep in mind with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.