C Command Line Arguments

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

#include<stdio.h>
#include<conio.h>
#include<string.h>
int main(int argc,char *argv[])
{
   // printf("\nTotal Arguements: %d",argc);
    // printf("\n1 Arguement: %s",argv[0]);
    // printf("\n2 Arguement: %s",argv[1]);
    // printf("\n3 Arguement: %s",argv[2]);
    system("cls");
  if(argc!=2) 
  printf("Required  2 Argument only: ") ;
  else
  {
      //printf("%s",strupr(argv[1])); 
      printf("%d",strlen(argv[1])); 
  } 


    return 0;
}

 

 

If you are Happy with DataFlair, do not forget to make us happy with your positive feedback on Google

courses
Image

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *