C

Saturday, 8 July 2017

Program to demonstrate array of strings

#include<stdio.h>
#include<string.h>
void main()
{                  
          char name[35][21];
          int n,i;
          clrscr();
          printf("Enter numbers of students");
          scanf("%d",&n);
          printf("Enter the %d students name\n",n);
          for(i=0;i<=n;++i)
          {
                   gets(name[i]);
          }
     printf("\n List of students is");
          for(i=0;i<=n;++i)
          puts(name[i]);
}

No comments:

Post a Comment

Write a program to draw a circle using mid-point circle drawing algorithm.

#include<iostream.h> #include<graphics.h> #include<conio.h> void drawcircle(int x0, int y0, int r) {         ...