Sign Up

Have an account? Sign In Now

Sign In

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

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

SIKSHAPATH

SIKSHAPATH Logo SIKSHAPATH Logo

SIKSHAPATH Navigation

  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
  • About
    1. Asked: January 14, 2022In: Data Science

      Write the function used to plot the barcharts. Bargraph should have (title of graph, name of x axis, name of …

      I'M ADMIN
      I'M ADMIN
      Added an answer on January 15, 2022 at 12:33 am

      Syntax: barplot(H,xlab,ylab,main, names.arg,col) Example: # Create the input vectors. colors = c("green","orange","brown") months <- c("Mar","Apr","May","Jun","Jul") regions <- c("East","West","North") # Create the matrix of the values. Values <- matrix(c(2,9,3,11,9,4,8,7,3,12,5,2,8,10,11),Read more

      Syntax:
      
      barplot(H,xlab,ylab,main, names.arg,col)
      
      Example:
      
      # Create the input vectors.
      colors = c("green","orange","brown")
      months <- c("Mar","Apr","May","Jun","Jul")
      regions <- c("East","West","North")
      
      # Create the matrix of the values.
      Values <- matrix(c(2,9,3,11,9,4,8,7,3,12,5,2,8,10,11), nrow = 3, ncol = 5, byrow = TRUE)
      
      # Give the chart file a name
      png(file = "barchartnew.png")
      
      # Create the bar chart
      barplot(Values, main = "total revenue", names.arg = months, xlab = "month", ylab = "revenue", col = colors)
      
      # Add the legend to the chart
      legend("topleft", regions, cex = 1.3, fill = colors)
      
      # Save the file
      dev.off()
      
      
      #goto your current directory(document) open file barchartnew.png
      #you will get image same as
      
      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    2. Asked: January 14, 2022In: Data Science

      Creates a dataframe with three columns named: name of student, age and marks. Then display the output in df variable. …

      I'M ADMIN
      I'M ADMIN
      Added an answer on January 15, 2022 at 12:25 am

      #SELECT ALL CODE AND RUN #CODE: data=data.frame( names = c("james", "john", "dany", "Larry", "Joe"), age = c(16,17,16,17,17), mark= c(90,95,80,88,99) ) df<-data print(df) names(df)[2] <- 'AGE' result<-df print(result)

      #SELECT ALL CODE AND RUN
      
      #CODE:
      
      data=data.frame( names = c("james", "john",
      "dany", "Larry", 
      "Joe"),
      age = c(16,17,16,17,17),
      mark= c(90,95,80,88,99)
      )
      df<-data
      print(df)
      names(df)[2] <- 'AGE'
      result<-df
      print(result)
      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    3. Asked: January 13, 2022In: Programming Language

      what are the types of functions in c language?

      I'M ADMIN
      I'M ADMIN
      Added an answer on January 13, 2022 at 10:23 pm

      There are Two Types of Functions in C predefined functions user defined functions Predefined functions These functions are already defined in the system libraries. Programmer can reuse the existing code in the system libraries which is helpful to write error free code. User must be aware of syntax oRead more

      There are Two Types of Functions in C

      • predefined functions
      • user defined functions

      Predefined functions

      • These functions are already defined in the system libraries.
      • Programmer can reuse the existing code in the system libraries which is helpful to write error free code.
      • User must be aware of syntax of the function.

      Example: printf() , clrscr()

       

      User defined functions

      • These functions must be defined by the programmer or user.
      • Programmer has to write the coding for such functions and test them properly before using them.
      • The syntax of the function is given by the user so there is no need to include any header files.

      Example: main(), swap(), sum(), etc..

       

       

      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    4. Asked: January 13, 2022In: Programming Language

      C program to count frequency of each element in an array

      I'M ADMIN
      I'M ADMIN
      Added an answer on January 13, 2022 at 3:58 pm

      #include <stdio.h> int main() { int arr[100], freq[100]; int size, i, j, count; printf("Enter size of array: "); scanf("%d", &size); printf("Enter elements in array: "); for(i=0; i<size; i++) { scanf("%d", &arr[i]); freq[i] = -1; } for(i=0; i<size; i++) { count = 1; for(j=i+1; jRead more

      #include <stdio.h>
      
      int main()
      {
      int arr[100], freq[100];
      int size, i, j, count;
      
      
      printf("Enter size of array: ");
      scanf("%d", &size);
      
      
      printf("Enter elements in array: ");
      for(i=0; i<size; i++)
      {
      scanf("%d", &arr[i]);
      
      
      freq[i] = -1;
      }
      
      
      for(i=0; i<size; i++)
      {
      count = 1;
      for(j=i+1; j<size; j++)
      {
      
      if(arr[i]==arr[j])
      {
      count++;
      
      
      freq[j] = 0;
      }
      }
      
      
      if(freq[i] != 0)
      {
      freq[i] = count;
      }
      }
      
      
      printf("\nFrequency of all elements of array : \n");
      for(i=0; i<size; i++)
      {
      if(freq[i] != 0)
      {
      printf("%d occurs %d times\n", arr[i], freq[i]);
      }
      }
      
      return 0;
      }
      
      OUTPUT:
      
      
      
      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    5. Asked: January 5, 2022In: Programming Language

      You’re given a directed graph with N nodes, and M edges. On this graph, you need to compute for each node u, the number of …

      I'M ADMIN
      I'M ADMIN
      Added an answer on January 11, 2022 at 3:52 pm

      #include <bits/stdc++.h> using namespace std; signed main() { int n, m, a, b; cin >> n >> m; vector<int> start(n); vector<vector<int>> adj(n); bitset<50000> ans[n]; for(int i = 0; i < m; i++) { cin >> a >> b; adj[b - 1].push_back(a - 1); startRead more

      #include <bits/stdc++.h>
      using namespace std;
      
      signed main() {
      int n, m, a, b;
      cin >> n >> m;
      vector<int> start(n);
      vector<vector<int>> adj(n);
      bitset<50000> ans[n];
      for(int i = 0; i < m; i++) {
      cin >> a >> b;
      adj[b - 1].push_back(a - 1);
      start[a - 1]++;
      }
      queue<int> q;
      for(int i = 0; i < n; i++) {
      if(start[i]) continue;
      ans[i].set(i);
      q.push(i);
      }
      
      while(!q.empty()) {
      int node = q.front(); 
      q.pop();
      for(int child: adj[node]) {
      ans[child] |= ans[node];
      start[child]--;
      if(start[child] == 0) {
      ans[child].set(child);
      q.push(child);
      }
      }
      }
      
      for(int i = 0; i < n; i++)
      cout << ans[i].count() << " ";
      cout << '\n';
      }
      See less
        • 0
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    6. Asked: January 10, 2022In: Data Structure

      Let’s change the assumptions and now assume that the jobs arrive at different times as follows:   Process Burst Priority …

      I'M ADMIN
      I'M ADMIN
      Added an answer on January 11, 2022 at 3:40 pm

      JUST TAP ON THE ATTACHMENT BUTTON FOR ANSWER: Support Us By Voting Up Answers!  

      JUST TAP ON THE ATTACHMENT BUTTON FOR ANSWER:

      Support Us By Voting Up Answers!

       

      See less
      Attachment

        • -1
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    1 … 90 91 92 93 94 … 122

    Sidebar

    store ads

    Stats

    • Questions 1k
    • Answers 1k
    • Posts 149
    • Best Answers 89
    • This Free AI Tool Translates Entire Books in Minute !
    • AI News: 🎬 Hollywood’s AI Studios, 🎓 OpenAI’s Latest Gift to Educators, 🚚 Class8 Bags $22M, 🧠 Google Gemini’s Memory Upgrade
    • AI NEWS: Legal Action Against OpenAI, $16M Paid, & Elon Musk’s Praise from Investor 🤖💰📑 | AI Boosts Cloud Seeding for Water Security 🌱💧
    • AI News: 🎬AI Video Tool Scam Exposed🤯, 🛰️ AI-Powered Drones to Ukraine 😱, Google’s $20M AI Push, Sam Altman Joins SF’s Leadership Team
    • AI News: 🤝 Biden Meets Xi on AI Talks, 💡 Xavier Niel’s Advice for Europe, ♻️ Hong Kong’s Smart Bin Revolution, 🚀 AI x Huawei

    Explore

    • Recent Questions
    • Questions For You
    • Answers With Time
    • Most Visited
    • New Questions
    • Recent Questions With Time

    Footer

    SIKSHAPATH

    Helpful Links

    • Contact
    • Disclaimer
    • Privacy Policy Notice
    • TERMS OF USE
    • FAQs
    • Refund/Cancellation Policy
    • Delivery Policy for Sikshapath

    Follow Us

    © 2021-24 Sikshapath. All Rights Reserved