bhai this is c# , as far as i think we use readline() function to take input from user , what u type is c++ .(cin). which will not run in c# compiler
koi to final solution upload kr do
change line cin >> userinput; with following your problem ressolve. but on page 2 another solution has been uploaded.
Console.Write("Hello, {0}", Console.ReadLine());
String[] assignment = new String[10];
for (int i = 0; i < 10; i++)
{
Console.WriteLine("Please write 10 Name one by one and press enter");
assignment [i] = Console.ReadLine();
}
c. Print Names array using foreach loop. [2.5]
foreach (string asgn in assignment)
{
Console.WriteLine(asgn);
}
d. Get a name and index from user. And replace the name on index (given by
user) with the new name. [5]
Console.WriteLine("Enter Name to replace :");
String tempname = Console.ReadLine();
Console.WriteLine("Enter index to replace with :");
String temp = Console.ReadLine();
int index = Convert.ToInt32(temp);
assignment [index] = tempname;
Console.WriteLine(assignment [index]);
e. Now use while loop to print the Names array. [2.5]
int a = 0;
while (a < 10)
{
Console.WriteLine(assignment [a]);
a++;
}
Jazakallah Hu Khair. please confirm have your done all with this code? i am gonna do that but possibly will be needed your help
Tested successfully but in the last after showing replaced index console window go close automatically. but its ok
Allah Apko jaza e khair daey.
FIRST QUESTION PLEASE
will you please upload screen shoot ?
why needed screen shot. question 2 ka answer sahi hai,, ap variable name change karen aur use karlaen apnaey assignment maen koi syntax ya logical error nahi hai.
Uploading Instructions:
• Your assignment must be in MS Word format.
• Use this compiler http://ideone.com/ , to compile your code section.
• First paste your code and then paste screen shot of your compiled code.
• Assignment will not be accepted through email.
Will you pleace write here the complete code?
In one compilation form.
Please give me the complete code which need compilation only.
I am confused with these parts of code. where to write which part of code.
Time is too short as you know.
JazakAllah.
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post