#include < stdio.h>
#include < string.h>

struct student {
    int id;
    float cgpa;
    char first[100];
    char last[100];
void first_numbers(int x) {
    int i;
    printf("\n\nHere is the details of all student\n\n");
    for (i = 0; i<x; i++) {
        printf("%d %s %s %f \n", s[i].id, s[i].first, s[i].last, s[i].cgpa);
int main()
    int n, i;

    scanf_s("%d", &n);
    for (i = 0; i<n; i++) {
        printf("Enter first name:");
        scanf_s("%s", s[i].first);

        printf("Enter last name:");
        gets( s[i].last);   
        printf("Enter ID:");
        scanf_s("%d", &s[i].id);
        printf("Enter CGPA: ");
        scanf_s("%f", &s[i].cgpa);


    return 0;

asked 03 Nov, 08:43

mahbubhimel's gravatar image


edited 03 Nov, 12:10

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦

আমি কোড রান করে দেখলাম ঠিক ভাবেই কাজ করছে । আপনি scanf_s এর পরিবর্তে scanf ব্যবহার করেন ।

permanent link

answered 03 Nov, 08:51

menon's gravatar image


ভাই ভিজুয়াল স্টুডিওতে scanf_s চায়। নাহলে এরর দেখায়।

(03 Nov, 08:54) mahbubhimel
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 03 Nov, 08:43

question was seen: 73 times

last updated: 03 Nov, 12:11