Questions: 1 978

Answers by our Experts: 1 850

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program to evalute the series.

1+3+5+7+........+n


Write a program to evalute the series.

1+3+5+7+........+n


Requires to follow the program template provided and use stack to solve the problem.



Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.


An input string is valid if:


Open brackets must be closed by the same type of brackets.

Open brackets must be closed in the correct order.


Example 1:


Input: s = "()"

Output: true


Example 2:


Input: s = "()[]{}"

Output: true


Example 3:


Input: s = "(]"

Output: false


Example 4:


Input: s = "([)]"

Output: false


Example 5:


Input: s = "{[]}"

Output: true


Program Template


#include <stdio.h>

#include <stdlib.h>


// This is where the parentheses are stored in memory

char buffer[1024];

char stack_pop();

void stack_push(char ch);

int stack_size();



int main(){

FILE *fp;

  // The parentheses sequences is in the parentheses.txt file.

  fp=fopen("parentheses.txt","r");

  if(fp==NULL){

   printf("The input file does not exist.\n");

   exit(-1);

  }

  // Read the parenthese sequences into buffer array.

  fgets(buffer,1024,fp);

  //printf("%s",buffer);

}


// The pop operation in the stack. To be done.

char stack_pop(){

return ')';

}



// The push operation in the stack. To be done.

void stack_push(char ch){

}



// The number of elements in the stack. To be done.

int stack_size(){

return 0;

}




Write a program to take input for students (id, name, cgpa) until id is given zero, put those student info into a linked list or add those student info at the tail of linked list. After adding all those students, print all student info into a binary file. Create another program to read the entries again.


Write a function int solution(int A[], int that given an array A consisting of N integers, returns the sum of all integers which are multiples of 4


My id is 193400005

Write C code for Atmega32 programming for the following scenario:

Create a LED pattern with 8 LEDs which will represent the BCD value of the last two digits of your ID. (Please notice this carefully).

For example, your ID is 201400076. Then the pattern will be 0111 0110.

The pattern will then start to loop in the following order.

Loop:

{

First 0111 will be on and 0110 will be off for 2.5 seconds.

Next, 0111 will be off and 0110 will be on for 2.5 seconds.

Next all 0111 and 0110 will be on for 2.5 seconds.

Next all will be off for 2.5 seconds.

}


---------------------------------------------------------------------------------------------------------------------------

2. Write C code for Atmega32 programming for the following scenario:

Divide the last two digits of your ID with 9 and find the remainder.


If the remainder is even, then use a 7-segment Commont Anode Display. If the remainder is odd, then use a 7-segment Common Cathode Display.


Now connect PORTC pin no. 0 to 6 with the display and display the last digit of your ID.


Given a compiler which allocates 4 Bytes of memory to an integer variable, then what is the range of numbers that can be stored in such variable? Explain your answer.



Write a system program in C that creates a backup of your home directory.


Write a C system program that creates a process chain of 32 processes having the following characteristics. 1. Each process prints two prime numbers that are generated randomly in the range of 1-1000. 2. Each parent must wait for its child process to terminate.

Your answer


Write a system program in C that outputs the number of words in all files in the current working directory in sorted order (minimum to maximum). Also, report the file name which has the most number of words.


LATEST TUTORIALS
APPROVED BY CLIENTS